Resolving #3242
At this point, user account is created even if user attributes assignment
(like setting password) fails. The cmdlet throws a
non-terminating error but ends up creating the user. This behavior is
confusing. As per the changes, the localuser account will be rolled back
in case of failure in user attributes assignment.
Two updates with this PR:
- reclassified automounted drives tests to be 'Feature' instead of 'CI' because this is more accurate;
- fixed failures in tests setup caused by "subst.exe" native utility having problems running as child process of powershell process tree run under "runas.exe /trustlevel:0x20000" (in Start-UnelevatedProcess in build.psm1).
* adds parameter sets to web cmdlets to allow for standard and non-standard method verbs
* add CoreCLI implementation
* Adds CM alias and notnullempty for CustomMethod parameter
* Add tests for Invoke-[WebRequest|RestMethod] CustomMethod parameter
* Fix webcmdlet tests - incorrect parameter name
XDG profile directory creation can fail for accounts that do not have home directories.
The module analysis was trying to persist it's cache in an XDG profile directory.
The cache is less critical than it once was, so it's reasonable to not cache if there is no good place to do so.
Fixes#3011
Changed hard coded Windows directory separator and resolved path so the slashes are correct.
Throw if resolving file path returns more than one result
Fixes#2610
These changes provide the ability to debug remote running scripts started with the Invoke-Command cmdlet. The design is event based and provides new public events that allow subscribers to be notified when an Invoke-Command remote session is ready for debugging. Since Invoke-Command allows running scripts on multiple targets at once (fan-out) the notification event is raised for each remote session as it becomes ready for debugging. The subscriber to these events will be a script debugger implementation (such as PowerShell console, ISE, or VSCode) and will handle all debugging details such as simultaneously debugging multiple remote sessions at once in separate windows.
But these changes also include an internal implementation which is used by default if host debuggers don't want to handle the debugging details. This internal implementation is what PowerShell console, ISE uses so they can have this new behavior without having to modify their debugger implementations. The internal implementation serializes each remote session of Invoke-Command so that they can be debugged one at a time. The remote session debugger is "pushed" onto the internal debugger stack so that debugging transitions to the remote session. Existing debugging commands work so that the "quit" debugging command will stop the current remote session script from running and allow the next remote session to be debugged. Similarly the "continue" debugging command allows the script to continue running outside step mode and again go to the next remote session for debugging. The "stepout" debugging command steps out of all Invoke-Command remote sessions and lets the script continue to run for each remote session in parallel as they are normally run.
The purpose of Invoke-Command step-in remote debugging is allow seamless debugging of a local script that calls Invoke-Command on remote targets. But there is also a new Invoke-Command "-RemoteDebug" parameter that lets you Invoke-Command on the command line and have it drop directly into the debugger.
An example from the PowerShell command line looks like this:
```
PS C:\> C:\TestICM.ps1
Entering debug mode. Use h or ? for help.
Hit Command breakpoint on 'Invoke-Command'
At C:\TestICM.ps1:2 char:1
+ Invoke-Command -cn $computerName,paulhig-3 -File c:\LinuxScript.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[DBG]: PS C:\>> list
1: $computerName = "localhost"
2:* Invoke-Command -cn $computerName,paulhig-3 -File c:\LinuxScript.ps1
3: "Test Complete!"
[DBG]: PS C:\>> stepin
At line:1 char:1
+ Write-Output "Running script on Linux!"
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[paulhig-3]:[DBG]: [Process:14072]: [Runspace5]: PS C:\Users\paulhi\Documents>
```
Notice that the debugger "stepin" command transitioned from local script debugging to debugging the remote session on computer "paulhig-3", as can be seen by the change in the debugger prompt.
You can also do this from the command line to drop directly into the debugger
```
Invoke-Command -cn localhost -Script $scriptblock -RemoteDebug
```
These changes also remove an old behavior that was incompatible with this new step-in feature. Previously if a remote session running script hit a break point it would stop in the debugger and go to the "disconnected session" state. This was to allow the user to reconnect using Enter-PSSession and then interactively debug the remote session script. This behavior has been removed and now the user needs to attach a debugger using the newer Debug-Runspace cmdlet.
* Prettier formatting for ConvertTo-Json output. #2736
This change standardizes JSON output to example given, as well as
codemaid and online lint tools.
Sample object used for testing:
@{
foo = @{
first = 'a'
second = 'bbbbbbbb'
}
barbarbarbar = @{
first = 'a'
second = 'bbbbbbbb'
NestedArray = @(
'Test3'
'Test4'
'Test5'
3
4
)
NestedObject = @{
MoreObject = 'AnotherObject'
TestBool = $true
}
}
array = @(
'Thing1'
'Thing2'
)
dan = 15
} | ConvertTo-Json
* Updated CoreCLR implementation to use NewtonSoft Indented Formatting
I did not change the FullCLR behavior, I was not sure if you meant to
revert my changes or to leave it as is in the current pull request.
* Added tests that validate pretty Json output.
Not sure if there is a better thought on how to implement these. The
first two fail against current master, but succeed once this PR is
applied. Third test is successful prior and post this PR.
* Moved tests and removed extraneous file.
Moved pretty/compressed json tests from standalone file into the
existing ConvertTo-Json test file.
* Updated tests for cross-platform support
* Implement -version parameter in console host (address part of https://github.com/PowerShell/PowerShell/issues/1084)
This does not support providing a specific version to run, but
like most other *nix commands, -version will now return the version
of the PowerShell Engine. 'powershell' is prepended to the output to
match other *nix commands. We are using gitcommitid which includes more
info about the build.
* Add ShouldProcess to New-FileCatalog and Test-FileCatalog
Close#3068
Add support `-WhatIf` and `-Confirm` to `New-FileCatalog` and add a
test.
`Test-FileCatalog` has a common code base with `New-FileCatalog` so it
automatically get the same. I believe that adding a separate test in
this case doesn't make sense.
* Fiz after code review
Remove _ShouldProcess
Add var in test
When a TypeTable is created it includes the types from type files provided along with references to the type files. When the InitialSessionState (ISS) object processes these types it reads the type files again and ends up with duplicate type entries. PowerShell V5.1 ISS type processing was re-written to improve performance and no longer removes duplicate types, so that this scenario (runspace ISS reuse) results in errors causing a regression.
The fix is to copy only type data when a TypeTable is passed to the ISS.
* Fix GetType() bad pattern and related issues in tests
$var.GetType() can raise an exception in tests so we should check $var
before make the call. A large part of the tests does not make this
check.
I start with searching ".GetType()" but discovered many related issues
in tests (reduntant and unneeded tests, "throw" bad pattens, bugs,
formattings (sorry!) and so on) - I had to fix them too.
* Fix after code review
* Second wave of migration GetType() -> BeOfType
Removed 'GetType().Name' patterns.
* Remove async tests for parser
this is a fix for https://github.com/PowerShell/PowerShell/issues/3069
This removes an attempt to work-around the issue of tests hanging on Travis-CI.
* remove unneeded finally block
* Improve console cmdlets tests
Main improvements refer to tests of the Write-Host cmdlet.
Original tests:
1. Slow because run external processes
2. Don't test colors and -NoNewLine in fact.
1. The original tests is preserved (deleted one as redundant) but marked
by 'Slow' tag. They is preserved because they actually check the output
on the work, not a test console.
2. Add negative color tests. (Code cover grow!)
3. Add tests based on TestHostCS. This test host has been refined so we
can see colors and a new line in output.
4. Add minor fixes for test modules loads.
Also I add support for Information stream. I originally planned to use
it but not actually used. However, I have left this as a useful addition
for future tests.
I wonder that a Write-Host console output is duplicated in Information
Stream - Is it by design? I left a debug print on this matter in the
test code.
* Fix after code review
* Corrections after code review
Suppress import-module warnings
Rename Describes
Add "-Object" test
Add Stream.Information tests with TestHostCS
* Add checks for Streams.Information and add comments
Interactive hosts expect an `IncompleteParseException` to signal that more input is expected.
When detecting errors, the parser can report 2 positions:
* where the error should be reported
* where the error was detected
Typically these are the same, so most error reporting methods have a single parameter.
For missing braces, the pattern is supposed to be to report the error after the opening brace, but the error is typically detected at the end of the file.
There were a few places where we were not consistent in reporting such errors, this PR corrects those places.
Native argument completers were not invoked when the argument was a single dash.
The fix is to treat unbound command parameters as command arguments for the purposes of parameter/argument completion.
* Make small optimization in parser tests
* Add Clear() for common command
Remove commands from AfterEach
* Refactoring test 'functions are resolved before cmdlets'
* Adding PowerShellHelpFiles package which contains default.help.txt to powershell-win-core
* Adding test case to validate that <pshome>/<culture>/default.help.txt is present. This is done by calling 'Get-Help'
* Updating get-help to skip searching for the help file when the InternalTestHooks.BypassOnlineHelpRetrieval is enable. This way, we force get-help to generate a metadata driven help object, which includes a helpUri that points to the fwlink defined in the cmdlet code.
* Updating get-help -online <cmdletName> tests to not delete the help files. Instead, I've added logic to get-help to not find the help file when the test hook BypassOnlineHelpRetrieval is enable.
* Corrected the opencover option to merge the output file
- Delete temporary zip file.
- Remove CodeCov uploading through cygwin.
- Add code to use Invoke-WebRequest to upload to CodeCov
* Codecov settings
- Wait for 1 build to start analysis.
- Do not wait for CI.
- Disable comments in PR.
* Addressed code review comments
* Fixing Invoke-WebRequest InFile parameter
* Adding aliases for Invoke-RestMethod and Invoke-WebRequest
* Adding test cases for Web cmdlets -InFile parameter
* Adding tests for Invoke-WebRequest (iwr) and Invoke-RestMethod (irm) using the cmdlet aliases.
* Remove the extra leading space
* Added functionality to improve failure triaging
- Nunit logs will be created to tests.
- Logs are copied to the Azure share.
- Pester is run with -Quiet
- Elevated and unelevated runs for tests with appropriate tags
* Copy logs to Azure share and upload to CodeCov
- Zip and copy to Azure log share
- Upload to codecov using cygwin
* Fixed varaible name in if condition
* Addressed code review comments
* Modified the destination folder structure for logs
- Creates a folder structure for yyyy-MM and Windows for storing logs
- Updated zip file name to not have illegal characters
* Modifications as suggested by codecov.io
* Added parameter alias to the Out-File cmdlet, allowing -FilePath to be used as -Path.
Relevant issue: https://github.com/PowerShell/PowerShell/issues/2923
* Test to confirm the alias I added to the Out-File cmdlet's -FilePath parameter works.
* Changed test for parameter alias as per feedback.
* Updating based on feedback.
Made formatting changes:
Added space between brackets and start of cmdlet.
Moved end bracket to before the pipe and Should Not Throw statement.
Removed -InputObject parameter for the test, as it was not needed.
* Added BeforeAll to the first part of the file. Replaced tabs with spaces.
#2945
* Fixing indentation within the test file
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.
Whereever possible, build tooling for CentOS has been reused.
Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.
* Update Dockerfile
Fix typos
* Stifle progress output in build.psm1 for some operations
Modify test failure presentation to use platform available XML methods
* Add timeout support for returning runtime parsing errors
Some of the language/parser tests have been hanging in a non-reproducable manner which
causes the CI system to invalidate the entire run. This change adds support for timeout
which will fail a test if it runs to long, rather than invalidate the entire run.
current behavior is still supported, and is not done in a new session:
PS> get-runtimeerror -src '1/'
At line:1 char:3
+ 1/
+ ~
You must provide a value expression following the '/' operator.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpectedValueExpression
Adding a timeout will do the operation in a async powershell session
PS> get-runtimeerror -src '1/' -timeout 5
You must provide a value expression following the '/' operator.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : ExpectedValueExpression
If the operation takes longer than the supplied timeout, a timeout error will be returned
PS> get-runtimeerror -src 'start-sleep 6' -timeout 2
get-runtimeerror : Operation Timed Out ('start-sleep 6')
At line:1 char:1
+ get-runtimeerror -src 'start-sleep 6' -timeout 2
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException
+ FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,Get-RuntimeError
* Modify native linux command tests to skip on Windows and pending on Mac
* remove verbose and progress output from help tests
* Be sure that Feature Counter tests only run on Windows
Also, only call add-type in CounterTestHelperFunctions.ps1 if we're going to actually run the tests
* do not run any get-computerinfo tests on non-windows systems
* suppress progress output from PowerShell Get tests
* remove -quiet from API and CRON Builds
Travis watches output from the build to ensure that it hasn't hung
we need to find a balance between too much output and not enough output.
A run which has too much output is killed because it looks like an error loop
A run which has too little output is killed because it looks like a hang
* Remove commented line in Import-Counter.Tests.ps1
Remove extraneous extra line in PowerShellGet.Tests.ps1
* Change `-as "type"` to `-as [type]` in build.psm1
Alter timeout to 10 seconds to be improve chances of not timing out for runtime parser checks
improve logic for counter tests to also skip for IoT
* use the existing function of SkipCounterTests rather than duplicate the logic in import-counter.tests.ps1
* Initial support for Fedora 24
This commit adds initial support for the Fedora distribution,
starting with Fedora 24.
Whereever possible, build tooling for CentOS has been reused.
Until the next release of PowerShell is compiled against .NET 1.1,
the Docker release image uses the CentOS 7 build, but loads
in the CentOS 7 version of `libicu50` via LD_LIBRARY_PATH.
* Update Dockerfile
Fix typos
* Fix test where Export-Alias * fails when only single file exists
The test expects multiple files to be present at the location. We
explicitly create multiple files now under $TestDrive and use that the
location for Export-Alias
Also, so test structure changes.
* Address code review comments
* 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'.