* Adding PlatformNotSupportedException to *-Counter cmdlets for IoT as pdh.dll is not available.
* Adding tests to validate PlatformNotSupportedException for the Counter cmdlets on IoT.
This script downloads the latest nightly build package and executes the
tests on it. It also downloads all necessary tools and then uploads the
results to Coveralls.io. The badge for coverage is posted on README.md
* All test reported as skipped if not applicable to the platform
Fixed files:
powershell\Modules\Microsoft.PowerShell.Management\Clear-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {
powershell\Modules\Microsoft.PowerShell.Management\Get-ComputerInfo.Tests.ps1:1325:
return
powershell\Modules\Microsoft.PowerShell.Management\Get-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {
powershell\Modules\Microsoft.PowerShell.Management\New-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {
powershell\Modules\Microsoft.PowerShell.Management\Registry.Tests.ps1:7:
if ($IsWindows -eq $false) {
powershell\Modules\Microsoft.PowerShell.Management\Registry.Tests.ps1:167:
if ($IsWindows -eq $false) {
powershell\Modules\Microsoft.PowerShell.Management\Remove-EventLog.Tests.ps1:1:if
($IsWindows -and !$IsCoreCLR) {
powershell\Modules\Microsoft.PowerShell.Management\TimeZone.Tests.ps1:17:if
($IsWindows) {
powershell\Modules\Microsoft.PowerShell.Security\FileCatalog.Tests.ps1:6:if
($IsWindows) {
powershell\engine\Help\HelpSystem.Tests.ps1:112: if ($IsWindows)
* Fix test after code review
* Move skiping to common 'try'
The tokenizer did multiple scans the script line to get tokens. Before
the fix the tokenizer on the first pass examined that string as
double-quoted (Expandable) string not as here string, figured the
average double quotation mark as a closing and then starting with the
single quotation mark continued processing the line as single-quoted
string which had no closing single quotation mark.
The fix is to stop the first scan pass after getting '=' (assume
assignment-expression '$a=' for next pass).
Type completion would behave strangely when there were multiple aliases for a given type (currently only possible with type accelerators).
The fix is to only select the accelerator that matches what the user typed.
Closes#2295
* This change fixes the Invoke-RestMethod cmdlet behavior if the input is neither xml nor json.
* test description
* fixed the failed tests
* removed some duplication
* refactoring: eliminated some double castings
* added JsonObject unit tests; enhanced JSON deserialization exception message
* refactored JsonObject.Tests.ps1
* entitled test cases
* formatting
* Refactor 'FindMatchingHandler' to get rid of recursion
Search state can be saved and used throughout the searching process without the recursion.
* Rank the exception types based on how specific they are
* Refactor code to find handler based on the rank of given handlers
When a PS class is defined in a module and the module gets reloaded, the class would still use the SessionState from the old module for execution, and thus it doesn't reflect changes to the module state during the reload. This fix is to make sure we always use the current EngineSessionState for PS class execution.
* Fix OpenCover.console.exe parameter ordering issue.
The targetargs parameter needs to be at the end, otherwise everything
after that is considered as part of targetargs.
* Addressed code review comments
* Removed unnecessary file
* Rebase onto .NET Core 1.1
Modify `Build.psm1` and `project.json` files to use .NET Core 1.1.
.NET Core 1.1 ships with an older dotnet/cli than has currently been used,
so we revert to use case-sensitive directory names for dependencies.
.NET Core 1.1 is a pre-requisite for supporting Fedora 24.
* PSReadLine: Bump major version of PSReadline to 6.0.0-*
* Microsoft.PowerShell.Commands.Utility: Bump major version of Microsoft.CodeAnalysis.Csharp
* Microsoft.PowerShell.SDK: Revert attempt to import netcoreapp1.1 instead of dnxcore
* build.psm1: Restore ability to specify version of dotnet-install.sh
* Assign $ProgressPreference = "SilentlyContinue" to reduce output size
Travis is still complaining that the log file is too big, eliminating progress is
another step to reducing output. It's also not needed for our CI environment.
* Removed white space at end of lines
* fix misplacement of progress preference setting
also fix up trailing whitespace
Using LanguagePrimitives.ConvertTo (to emulate what would happen if the property were a regular .Net property typed as string), we now convert the value assigned to an XML property to string.
* RFC 0010 SSH remoting cmdlet updates.
* Tweaks to SSH remoting cmdlets
* SSHTransport parameter is now optional instead of mandatory. Aded fix for CoreCLR entry point when hosted in SSH as a subsystem.
* Added tests
* Code review feedback
* Code review comment changes
* Making SSHTransport switch parameter mandatory because otherwise existing Invoke-Command parameter set
* The new SSH parameter set was causing legacy positional based parameters to no longer work. This fix separates the SSH parameter sets from the existing WinRM parameter sets.
* Fixed region name spelling error.
A non-terminating error is thrown when the namespace does not exist by
Get-CimInstance. The namespace is not present on OS versions below Windows
10. It is not caught in the try-catch unless ErrorAction Stop is added.
- Updated Restore-PSModule function to delete the PSGetModuleInfo.xml so that this file will not be included in the PowerShell release.
- Since PackageManagement module gets installed with PowerShellGet module, removed PackageManagement module name in Restore-PSModule command invocation.
# The first commit's message is:
Changed to PSModuleRestore switch, i.e., by default no PSModule install
# This is the commit message #2:
install PowerShell modules to publish folder as well as one level up
# This is the commit message #3:
removed workaround
* added type to returned objects
replaced expand-ziparchive with call to Archive module
added defaults to location of opencover.xml, opencover installation, powershell.exe, and location of tests
updated error messages with corrective action
replaced System.Net.WebClient call (not available on coreclr) with invoke-webrequest
scoped change of executionpolicy to process when starting pester to avoid error if system policy is less restrictive
updated version of module
* addressing code review feedback
- check for git before using
- check for opencover.console in path
- fixed path to code coverage build of PS
* added Expand-ZipArchive back to support psv4 scenario
* Add support W3C Extended Log File Format
1. Add support W3C Extended Log File Format
2. Refactoring Import-Csv tests
3. Add #Type tests
* Fx test after review
* Fix tests after review
* Remove unneeded test
* Added tests to close code coverage in CIM area
Added CimAdapter.Tests for adaptation layer (code cribbed from BVT tests)
Added SessionOption.Tests.ps1 (Code cribbed from BVT tests)
Modified CimClass tests by adding more tests
Added CimSession.Tests for basic tests of New-CimSession cmdlet
Added CimInstance.Tests for basic tests of Get-CimInstance
* Add CI tags to tests
* unify test execution to use try/catch for marking tests as skipped
moved test which retrieves cimclass via method to feature as it is not
a common operation, this test can take some time as well
* Write-Information accept objects from the pipeline
* Add test
* Fix test
Remove unneeded runspace.
* Clear streams before each test case
Streams of the PowerShell instance might have records from other test runs. Clear the streams before each test case.
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.
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.
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`.
* 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
* 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
* 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)
* Enable WebRequestPSCmdlet to not validate HTTPS certificates
Added switch parameter IgnoreCertificateCheck to WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod to not validate the HTTPS certificate of the server if required.
* Changed IgnoreCertificateCheck parameter name to NoCertificateCheck
Changed the switch parameter IgnoreCertificateCheck to NoCertificateCheck for WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod.
* Changed NoCertificateCheck parameter name to SkipCertificateCheck
Changed the switch parameter NoCertificateCheck to SkipCertificateCheck for WebRequestPSCmdlet to enable Invoke-WebRequest and Invoke-RestMethod.
* Added test for SkipCertificateCheck parameter
Validation of SkipCertificateCheck parameter in Invoke-WebRequest and Invoke-RestMethod. First validating, that exception is thrown for HTTPS URI with expired certificate. Then validating, that no exception is thrown if SkipCertificateCheck parameter is used. HEAD method must be used for Invoke-RestMethod to not return any body. Invoke-RestMethod can't parse the HTML returned when using GET method.
* Updated test for SkipCertificateCheck parameter to use ExecuteWebCommand function
There was a NullReferenceException after turning on constrained language mode
if creating a binding on a thread with no runspace.
The fix is to assume if there is no runspace that we are not in constrained language
mode, and also generate a binding restriction that assumes the same.
Resolving #2570.
Ignore drive paths in the check. If the input is a drive path,
then "\" is passed as the path to GetDriveQualifiedPath with drive info.
Since, the path here starts with "\", treatAsRelative is set to false
which prevents further formatting of this path.
The check is only valid for PSDrives with root path equals to UNC paths or the paths
in unix.
There are mainly 2 changes:
1. When '-ExcludeProperty' is specified but '-Property' is not, use "*" as the default value for '-Property'.
2. Allow 'Select-Object -Property noexist-name' to return a PSObject with property noexist-name, unless noexist-name itself contains wildcards.
* Fixes#2534 by replacing expensive WMI query with Win32 API calls
* fix break on unix build
* added tests for #2535
* although test passed, fixing exception that shows up
* fixed Describe text
* addressing code review feedback
* addressing review feedback to comment on why sleep is needed
added check that test processes are created before we try to kill them
* fixed test to timeout and pending fix for #2561
Resolving #2206
Set-Content fails to create a file for PSDrive path, if the path root
begins with defaultPathSeperatorString (ex: UNC path and paths in Single
rooted filesystems like Unix)
* Add support <Suppress> in Get-WinEvent -FilterHashtable
1. Add support <Suppress>
2. Refacrtoring BuildStructuredQueryFromHashTable() to use StringBuilder
3. Add tests
* Changelog
In PS Core on windows, we try to locate the default web browser and use it for online help. If we cannot find the default web browser (in NanoServer/IoT), we error out.
* Fix host remote test InvokeOnRunspace to work with AppVeyor
* Updated to use new local account for remoting tests.
* Set the LocalAccountTokenFilterPolicy as needed.
* Adding verbose messages for debugging.
* Storing creds using Export-CliXml
* Added CITravis skip for Windows only remoting test
* Moving tests back to 'Feature' scope
* Added AppVeyor environment variable check to prevent account creation on non-appveyor configurations
* Removed It block in BeforeAll block
* Moving tests back to 'Feature'
Fix Get-WinEvent -FilterHashtable to work with named event data field
Now FilterHashtable parameter in Get-WinEvent for named data field:
1. generates a valid query, ex. @{Logname="System";Param="a"}
2. generates a valid query for multiple values, ex.
@{Logname="System";Param="a","b"}
Also removed double cast in the original code and added more tests to cover the fixed scenarios.
CategoryInfo.Activity of Write-Error does not honor the value for
'activity' but uses the hard-coded string 'write-error'. The change sets
the value if specified by Write-Error cmdlet or set 'write-error'.
PowerShell can be started with input redirected in different scenarios.
`powershell -Command -` is one scenario where commands are sent to
PowerShell, but this is not a interactive shell scenario, it's really
a server to run commands from some other process.
`powershell -File -` or just regular redirected input means PowerShell
is an interactive shell, but command line editing must be done via
the redirected standard input handle instead of interacting directly
with a console handle.
In this scenario, we want to provide a good editing experience. Today,
we provide the bare minimum, supporting backspace but no cursor movement.
The bug here is that backspace was treated as a backspace in the server mode
but should not have been.
1. Added parameterbinding test
2. Added ShouldBeErrorID function in helper file
3. Removed ShouldBeErrorID function from other test modules
4. Update New-TestHost to be able to run on full CLR
5. updated file map.json
* Update CredentialCommands.cs
Added possibility to add title to the credential prompt window.
Added possibility to only supply username without giving a message.
* Added Test for Get-Credential new feature. (Title, and Message only optional.)
* Use a variable (which can be indexed by line) instead of a file to
test the output of arguments passed to echoargs
* Add comments explaining the tests
* Rename Publish-EchoArgs to Publish-PSTestTools so it can be used
for other tools as well in the future
* Publish EchoArgs to the bin directory instead of run to match
convention
* Add source URL to EchoArgs header comment
* Use wildcard of "*.nuget.props" to match
"test/csharp/csharp.nuget.props" in .gitignore
Also includes these bugfixes:
- WSManConfigProvider.GetHelpMaml: Tried to load XML from
MemoryStream that was created from file name string. Use XmlReader
instead.
- WSManConfigProvider.GetHelpMaml: Use Path.Combine instead of
platform-specific directory separator character.
- WSManConfigProvider.GetHelpMaml: CmdletHelpPath MAML XML element
attribute `ID` name casing seems inconsistent with other help.xml
files. XPath 1.0 does not support case-insensitive expressions,
use both `id` and `ID` in query.
- Add Pester test to verify that Get-Help shows provider-specific help.
Fixes#2088
The input loop reading from stdin did not handle multi-line input correctly
because it was adding a newline character where none was expected.
The fix was to not include the final newline character to accept input,
just like Console.ReadLine or PSReadline would.
this one is a bit tricky, unless you're elevated you can't set the date
however, if you are not elevated you should get an error. This file
does one or the other based on whether you're elevated
* 1. Update PowerShellGet to install the modules and scripts to proper locations in PowerShell Core on Windows. 2. Added few CI tests for PowerShellGet
* Handling the scenario of FullCLR-based PowerShell on Windows.
* [build.psm1] - mc.exe input file needs quotes
For filenames that have spaces or paths to that file that have spaces, the input filename needs to have quotes around it.
* Quoted more paths so tests run from directories with spaces
Found a few locations where paths weren't qutoed or escaped with '& ...' that are needed to get tests to run from build directories with spaces in them.
These are not currently implemented and so should not show up as
available.
The *-Computer cmdlets are already not compiled for Unix (and so not
available), so let's not declare them in the manifest.
The Get-ComputerInfo cmdlet does not work on Unix and so should not be
made available.
Test-Connection depends on an unavailable WMI provider.
Get/Set-TimeZone are not yet ported.
Root cause: Microsoft.WSMan.Management and Microsoft.PowerShell.Commands.Diagnostics are not put in the default snapin list for win-ops, and thus when a runspace is created using RunspaceConfiguration, those 2 are not loaded as snapins by default, which is a behavior change compared to Nano PS.
Fix: Replace the guard 'PORTABLE' to be 'UNIX' so that they are in the default snapin list when targeting windows platform.
only create the enumtest type if it doesn't exist
don't try to compare line endings on json tests which contain arrays,
formatting of the output need not be validated
set executable bit on Linux/MacOS as that's what determines whether something
is executable. Also simplify partial path creation, only remove up to the first
colon, so those filesystems which have a single root are treated properly
Fix#1361
On CoreCLR 1.0.0 RTM the layout changed compare to RC2.
This change accounts for it.
This change also cleans up some left-overs for SecureString ref.
- Replace src\powershell top level project by two
new root-level projects:
- src\powershell-unix
- src\powershell-windows
- Break src\Modules into more granular structure:
- Shared
- Windows+Unix-Core
- Windows-Core
- Windows-Core+Full
- Windows-Full
- To be created: Unix-Core. We will do it as a separate PR
- Fix#1122 : Platform-specific set of Modules (and assemblies)
- Fix Start-TypeGen to work with new top level folders layout
replaced dir with get-childitem
used appropriate path when importing pester
verified failure count was 0
split test case verification into individual it's so we get all the info.
Essentially, other tests may set breakpoints and the Id is ever
increasing, so a test for Id 0 will only be true if this is the
first time a breakpoint has been set in this session
Made a fix to store data on testdrive instead of system drive
Made a note of where the tests where ported from
Skipped entire test file on non-windows machines
The -Qualifier code for Split-Path made some incorrect assumptions:
* That a path only referred to the file system
* That drives cannot be used on Unix systems
These assumptions were both wrong, so I've reverted the change so we
do not have any Unix specific code in Split-Path now.
Fixes#1176
This restructuring moves tests to a directory name which matches the module
in which the cmdlet resides which should improve the discoverability of a
specific test.
For tests which are not about cmdlets in a module, new directories have been
created to make those tests easier to find as well