Commit graph

4483 commits

Author SHA1 Message Date
Sergei Vorobev e038360087 Prettify NativeCommmandProcessor.cs
- Move ProcessOutputHandler outside of NativeCommmandProcessor
- Remove redundent ConsumeAvailableNativeProcessOutput() blocking call
2016-11-15 14:49:39 -08:00
Sergei Vorobev 616c15556f Re-shuffle minishell tests 2016-11-15 14:49:39 -08:00
Sergei Vorobev c0bda7a55a Add native pipelines entry to changelog.md 2016-11-15 14:49:39 -08:00
Sergei Vorobev f0a4a7d821 Replace spin-lock by a proper BlockingCollection in NativeCommandProcessor 2016-11-15 14:49:39 -08:00
Sergei Vorobev 89782f92d2 Clean-up unnesesary fields from NativeCommandProcessor 2016-11-15 14:49:39 -08:00
Sergei Vorobev a6fc5387c2 Add a code to handle finished process correctly on Unix 2016-11-15 14:49:39 -08:00
Sergei Vorobev 9658e62682 Add a test for broken linux pipe in native pipeline 2016-11-15 14:49:39 -08:00
Sergei Vorobev 666bf887d7 Use StreamWriter.Dispose() instead of Close() 2016-11-15 14:49:39 -08:00
Sergei Vorobev df6662aa2e Fix flushing mechanics for input writer in native pipe 2016-11-15 14:49:39 -08:00
Sergei Vorobev 584aec7c92 Add motivation example for the native pipeline changes 2016-11-15 14:49:39 -08:00
Sergei Vorobev 747f5ff164 Make native pipeline consume available output in the process block 2016-11-15 14:49:39 -08:00
Sergei Vorobev 6acc1e0629 Add error stream and information stream tests
for native pipes
2016-11-15 14:49:39 -08:00
Sergei Vorobev b93042670f Improve pipeline for native commands
- Start native process in Prepare() instead of Complete()
  in NativeCommandProcessor.
- Remove unneeded input, output, error threads. Replaced by
  simpler primitives.
2016-11-15 14:49:39 -08:00
Sergei Vorobev a05fffd9dc Add a minishell clixml tests 2016-11-15 14:49:39 -08:00
Matt Wrock e1db642c7f Ensure *nix platforms add an initial / rooted drive (#2679) 2016-11-15 10:27:12 -08:00
Jason Shirk (POWERSHELL) ca2dce3537 Improve coverage for Write-Information output 2016-11-14 14:03:30 -08:00
Jason Shirk (POWERSHELL) 0d3021c5ca Delay initialize some properties in InformationRecord
An InformationRecord instance is created when calling Write-Host,
but many of the properties aren't read.

It can be expensive to initialize some of those properties, so
the code has been changed to initialize those properties on first access.
2016-11-14 14:03:30 -08:00
Jason Shirk (POWERSHELL) acdf1c1d44 Fix LengthInBufferCells test for downlevel
When running on systems that do not support a virtual terminal,
the tests was incorrectly assuming escape sequences were removed.

The fix is to expect different results depending on whether or not
the host supports virtual terminal mode.
2016-11-14 13:59:43 -08:00
nmbradford 25005a0ba0 Fix WebRequest failure to handle missing ContentType in response header (#2666)
If a response to invoke-webrequest does not set the content type in the
response header, an object not set exception is thrown in
WebResponseHelper.CoreClr.cs.  Updated to set contenttype = null.
2016-11-14 13:35:07 -08:00
Dongbo Wang fe9064868e Fix PackageManagement issue in the latest Alpah12 on Linux (#2665)
* Registry.LocalMachine throws on non-windows platform.

* address cr feedback
2016-11-14 12:51:36 -08:00
Sergei Vorobev 0228d7e50f Fixed reference to 0-backlog in CONTRIBUTING.md (#2681) 2016-11-14 11:30:54 -08:00
Sergei Vorobev dbc084537a Remove default value for version from Install-Dotnet, so it's controlled only in Start-PSBootstrap 2016-11-14 11:27:38 -08:00
Sergei Vorobev f5ca586118 Temporarely pin dotnet obtain script url 2016-11-14 11:27:38 -08:00
Jianyun Tao 260b6af5fe address cr feedback 2016-11-14 10:16:15 -08:00
Jianyun Tao 24d720ebc1 Merge remote-tracking branch 'upstream/master' 2016-11-14 10:08:47 -08:00
Steve Lee b4738c8711 Update CONTRIBUTING.md
fix link
2016-11-14 10:05:07 -08:00
Steve Lee ddb1af7fbd Update CONTRIBUTING.md
Fixed reference to 0-backlog
2016-11-14 09:08:02 -08:00
Bryce Milton - MSFT 8bc8930959 Refactoring Linux Nighly Dockerfiles to in-line Bootstrap.ps1 code
Provides simpler usability by making the dockerfiles self-contained.
2016-11-11 21:02:52 -08:00
Bryce Milton - MSFT 69c9228671 Updating to Alpha 12 and correcting 'reslease' typo 2016-11-11 21:02:52 -08:00
Bryce Milton f56806b614 Updating to use Alpha-11 URLs\SHA
Updated URLs to point at Alpha 11 URLs, reduced number of intermediate
stages, simplified logging code, and added a new %PSCORE% environment
variable to make it easier to launch from other shells
2016-11-11 21:02:52 -08:00
Bryce Milton ebc0dfe575 Release versions of WindowsServerCore and Nano DockerFiles
Embedded POWERSHELL_* ARGs will need to be updated when new releases
become available
2016-11-11 21:02:52 -08:00
Dongbo Wang dad2c7d155 Update releasing doc to include steps to create Linux/macOS packages and NuGet packages (#2663)
* Update releasing.md with package creation steps for Linux and macOS

* Add documentation for creating NuGet Packages

* Minor fixes
2016-11-11 17:13:04 -08:00
Jason Shirk bd9e49d8d9 Make Out-Null fast (#2629)
People use Out-Null despite much faster alternatives:

    $null = Do-Stuff
    [void] = Do-Stuff
    Do-Stuff > $null

This change makes Out-Null work in roughly the same say as the above.

The optimization is to detect that we're calling the built-in Out-Null
cmdlet when invoking a pipeline from script (the change won't have any
effect in the PowerShell api). If we detect Out-Null, we rewrite the
pipe to look similar to `Do-Stuff > $null`.
2016-11-11 11:29:53 -08:00
Aditya Patwardhan b18adb85d4 Add OpenCover PS Module to collect code coverage (#2585)
* Add OpenCover PS Module to collect code coverage

OpenCover PS Module helps is collecting Code Coverage using the OpenCover
toolset. The module helps in comparing two code coverage runs as well.

* Change OpenCover.psd1 to ASCII

* Fix an error in path for OpenCover

Fixed an error on path for OpenCover. Also used ZipFile class instead of
cmdlet as it might not be available on CI system.

* Convert module to be Powershell v4 compliant

Changed implementation from classes to PSObjects and implemented
Expand-ZipArchive.

* Added CodeCoverage as a configuration to project.json files

Added CodeCoverage as the new configuration for all the project.json
files. When Start-PSBuild is executed with configuration as CodeCoverage,
we change the degubType to 'full' as required by OpenCover toolset.

Also made changes to appveyor.psm1 to build a CodeCoverage package on
daily builds and publish it as a zip.

* Addressed code review comments

Changed from Add-Member to use pscustomobject type accelator. Removed
[gc]::collect.

* Added explicit garbage collection

* Addressed code review comments

- Make sure that the build Start-PSPackage gets is not a code coverage
  build
- Add debugType = full for FullCLR
- Remove configurations from PackageManagement files as it is not needed.
- Build CodeCoverage build first in AppVeyor.

* Resolve merge conflict

* Fix indentation

* Fix newline at end of file

* Added command discovery for locating OpenCover.console.exe
2016-11-11 11:12:07 -08:00
Jianyun Tao 5e8f9e8617 Registry.LocalMachine throws on non-windows platform. 2016-11-10 15:10:56 -08:00
iSazonov b56bbeabc6 Add Get-Uptime to Microsoft.PowerShell.Utility (C# cmdlet) (#2517)
* Add Get-Uptime (C# code)

1. Add Get-Uptime cmdlet (C# code)
2. Modify psd1 files
3. Add tests

* Remove Pretty parameter after Powershell committee conclusion

1. Remove Pretty parameter
2. Remove tests for Pretty
3. Add Throw if  IsHighResolution is False
4. Fix formatting

* Add test to check throw

1. Add hook that simulate 'System.Diagnostics.Stopwatch.IsHighResolution == false' to test Get-Uptime throw
2. Add test to check throw

* Fixes after review

1. Remove Timespan parameter
2. Remove unneeded tests
3. Fix localization
4. Add string consts
5. Fix throw

* Fix OutputType to add parameter set name information
2016-11-10 09:51:29 -08:00
Nana Lakshmanan 2077e42b52 Fixing background jobs for Unix and Windows (#1972) 2016-11-09 22:44:39 -08:00
Lincoln Atkinson 594fae475b Wire up proper ConsoleHostRawUserInterface.LengthInBufferCells for Unix (#2637)
* Wire up proper ConsoleHostRawUserInterface.LengthInBufferCells for Unix

Ref https://github.com/PowerShell/PowerShell/issues/2502
This allows for Unix console host to properly calculate display width for
strings containing escape sequences (e.g. ANSI color), rather than
falling back to naive string.Length.

* Add basic tests for host LengthInBufferCells calculation
2016-11-09 10:20:31 -08:00
Sebastian N 611f7f9b77 Fix small typo (#2647)
it's -> its
2016-11-09 10:19:53 -08:00
iSazonov 760a9c2997 Improve a progress pane performance (#2640)
* Improve a progress pane performance

Add timer to update a progress pane every 100 ms
2016-11-08 11:21:28 -08:00
Adam Bertram 35b844a756 Fixed broken link in README (#2643) 2016-11-08 10:22:26 -08:00
Steve Lee ae7b857c23 removed Handles column from Process formatter (#2617)
addressing #1812
2016-11-07 10:39:19 -08:00
Francisco Gomez Gamino 92b0eb336d Adding tests for update/save-help, and fixing existing help tests for
Linux.
2016-11-04 16:39:57 -07:00
Francisco Gomez Gamino fea4d883e8 Fixing update/save-help on Linux. 2016-11-04 16:39:57 -07:00
Steve Lee 7c302856d8 Update KNOWNISSUES.md (#2624)
Removed select-xml from the unsupported table based on #2316 as it appear to be working on PSCore on windows
2016-11-04 16:35:52 -07:00
Dongbo Wang 5bda59b76b Add 'AssemblyVersion' to 'GraphicalHost' and 'LocalAccounts' projects 2016-11-04 16:33:35 -07:00
Dongbo Wang f96dcbb016 Update project version to 6.0.0 to match our release version 2016-11-04 16:33:35 -07:00
Mike Richmond 8c50456b8f Fixing alpha.11 name change (#2628) 2016-11-04 16:31:26 -07:00
Charu Bassi 3349f84ed0 Changes to get security zone when urlmon.dll is not present (#2625) 2016-11-04 16:18:09 -07:00
Kirk Munro 244827a4aa Added -Top/-Bottom params to Sort-Object for Top/Bottom N sort and many Pester tests (#2518)
* Added -Top/-Bottom params to Sort-Object for Top/Bottom N sorts; added many Pester tests

* updated changelog

* updated CHANGELOG.md

* replaced Get-Service with Get-Alias in Pester tests

* improved performance for -unique -top/-bottom, changed according to PR feedback

* added newlines to end of two files

* Removed whitespace changes

* Missed 2 whitespace changes to undo in last commit

* Updated to try to resolve merge issue

* change heapify return type, cleaned up test code

* unique top/bottom N sorts are now 2-3 times faster

* code cleanup (removed unused vars, simplified logic)
2016-11-04 14:09:48 -07:00