- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'ForEach-Object' (alias is '%' or 'foreach')
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Where-Object' (alias is '?' or 'where')
- Fix PSScriptAnalyzer warnings of type PSAvoidUsingCmdletAliases for 'Select-Object' (alias is 'select')
- Fix PSScriptAnalyzer warnings of type PSPossibleIncorrectComparisonWithNull. Essentially, $null has to be on the left-hand side when using it for comparison.
- A Test in ParameterBinding.Tests.ps1 needed adapting as this test used to rely on the wrong null comparison
- Replace a subset of tests of kind '($object -eq $null) | Should Be $true' with '$object | Should Be $null'
* updated webcmdlets CI tests to not depend on external website
* When used in background runspace, validate listener is working before returning
* fix possible infinite loop waiting for listener to start
* Add -SkipHeaderValidation switch to Invoke-WebRequest and Invoke-RestMethod to support adding headers without validating the header value.
* Fix whitespace
Invoke-WebRequest and Invoke-RestMethod cmdlets will now strip authorization header on redirect unless the new parameter `-PreserveAuthorizationOnRedirect` is specified.
The FullCLR implementation uses WebRequest to perform the request which silently strips the Authorization header when a redirect occurs.
The CoreCLR implementation uses HttpClient to perform the request which does not strip the authorization header. The change explicitly handles the initial redirect, removes the authorization header and submits the request to location in the response.
Fixes#2227
This improves the performance of the listener by not relying on a new
process starting up to run the listener. It improves the debugability
of tests by providing more direct access to the session executing
the listener. It also reverses the blocking nature of starting the
listener. By default, Start-HttpListener will no longer block, you need
to use -Foreground to have Start-HttpListener block. Lastly, create
a way to catch errors if the listener has a problem. If code in the
listener throws, it emits an error record.
* Support Link Header pagination in WebCmdlets to make it easier for the end user implementing:
https://github.com/PowerShell/PowerShell-RFC/blob/master/2-Draft-Accepted/RFC0021-Link-header-based-pagination-for-WebCmdlets.md
When the response includes a Link Header (https://tools.ietf.org/html/rfc5988#page-6), for Invoke-WebRequest we
create a RelationLink property that is a Dictionary representing the URLs and rel attributes and ensure the
URLs are absolute to make it easier for the developer to use. For Invoke-RestMethod, we expose a -FollowRelLink
switch to automatically follow 'next' rel links to the end until we hit the optional -MaxRelLink parameter value.
* removed unnecessary refs to namespaces
* addressed code review feedback