Commit graph

1032 commits

Author SHA1 Message Date
Mike Richmond 1a8563336a [Feature] Mark failing tests as pending to unblock the nightly test pass (#4538) 2017-08-09 15:12:59 -07:00
James Truher [MSFT] eccfd691ba Improve code coverage for Get-Item cmdlet (#4385) 2017-08-09 14:15:17 -07:00
Dongbo Wang 5d53bd373a Fix the hang issue in Travis CI build triggered by the [Feature] tag (#4536)
* Fix the hang issue in Travis CI build triggered by the [Feature] tag

* [Feature] Update badge only in daily build

* [Feature] Use the term 'daily build'
2017-08-09 14:01:52 -07:00
Mike Richmond 515a999e1c Porting Enable-PSRemoting and its Tests (#2671)
Fixes #1193 for most scenarios. The remaining scenario to be addressed is the Nano Server bring-up scenario. To continue supporting that scenario, I left the Install-PowerShellRemoting script in place.

This change 
1. Ports Enable-PSRemoting and Disable-PSRemoting to PowerShell Core
2. Adds side-by-side PowerShell Core remoting support to the PSSessionConfiguration cmdlets and PSRemoting cmdlets.
3. Ports PSSessionConfiguration tests

This change also introduces a behavioral difference. The PSRemoting and PSSessionConfiguration cmdlets are now context-sensitive and only work for endpoints that match the PowerShell type. For example, Get-PSSessionConfiguration, when running in PowerShell Core, will only return PowerShell Core WinRM endpoints. It will only modify PowerShell Core WinRM endpoints and cannot be used to configure Windows PowerShell endpoints.
2017-08-08 09:36:22 -07:00
Mark Kraus e4060ab892 Fix Tests from #4479 (#4512)
* Fix Tests from PowerShell/PowerShell#4479

* [Feature]
2017-08-07 16:06:37 -07:00
Oisin Grehan 8d3f8537de Ignore case when binding PSReadline keyhandler functions
Fix #4300
2017-08-07 14:24:35 -07:00
Andrew 0b7451bda3 Tests for New-WinEvent (#4384)
* New-WinEvent tests

* PR feedback

* PR feedback 2

* PR feedback 3

* PR feedback 4

* PR feedback 5
2017-08-07 14:24:12 -07:00
Andrew 99236b18bb Make ResourceManagerCache check for alternative resource paths (#4139) 2017-08-04 15:39:26 -07:00
Steve Lee d17aaad4a0 Ensure running powershell within PowerShell starts instance of currently running PowerShell (#4481)
Modify PATH env var at startup so that $PSHOME is in front
2017-08-04 09:23:15 -07:00
Aditya Patwardhan 5cd0e85d12 Fixed passing common test modules path to unelevated Powershell (#4313)
- Fixed the way common test modules are passed to elevated and unelevated powershell. Earlier, only elevated powershell got those through inheritance as a child process. Now we add them to the startup of the process.
- Fixed error reported by PSScriptAnalyzer about ? / Where-Object
- Converted all the parameters passed to powershell.exe to be a base64 encoded string to avoid complications with quotes.
- Removed code which was updated $env:PSModulePath as we do it in startup args for powershell process instead. 
- Added a way to disable -Quiet for Pester.
- Opencover.console.exe gets confused when the base64 encoded parameter is given with '&' invoke.
Writing to a ps1 file and invoking the script works around the issue.
This also makes it similar to how unelevated tests are invoked.
2017-08-04 09:16:17 -07:00
Mark Kraus fc77c7981a Extend -SkipHeaderValidation to include -UserAgent to support non-standard User-Agent headers (#4479) 2017-08-04 09:10:24 -07:00
Dongbo Wang 6d32293437 Add more tab completion tests (#4356)
* Add more TabCompletion tests

* Minor changes

* Add some more tests

* Add more tab completion tests

* Fix errors

* Add more test coverage

* Add 'AfterEach { Pop-Location }'

* Enable DSC resource name completion and address comments

* use both '/' and '\' in the path for completion

* Use a separate test for '\' and '/'
2017-08-03 15:26:20 -07:00
James Truher [MSFT] fbe547e4ab Change test to not set PSDefaultParameterValues (#4482)
Create a local variable for determining whether the test should be skipped.
Also, change the depth of `Export-Clixml` to speed up tests.
2017-08-03 15:06:37 -07:00
David Christian 1a003a8af3 Support Positive/Negative ValidateRange (#4084)
To improve code clarity and give better error messages when using ValidateRange, you can now specify:

```
[ValidateRange(ValidateRangeKind.Positive)]
```

instead of

```
[ValidateRange(1, 2147483647)]
```

Valid kinds are:

Positive
Negative
NonPostiive
NonNegative
2017-08-02 11:24:06 -07:00
jeffbi 19fcd43b85 Add test coverage for Registry (#4354)
* Add test coverage for Registry (#4148)

* Add coverage for Get-Item, Get-ChildItem, Set-Item, and Clear-Item

* Add test for accessing inaccessible path, per code review.
2017-08-02 09:53:31 -07:00
jeffbi 8f9aed806e Increase test coverage for Rename-Item and Move-Item (#4329)
* Increase test coverage for Rename-Item and Move-Item
* Add access-denied tests
* Add -skip on Unix for access-denied tests.
2017-08-02 09:51:22 -07:00
Steve Lee e64e68bcdc Allow passing $true/$false as parameter to script using -File (#4178)
Using powershell.exe to execute a PowerShell script using -File currently provides no way to pass $true/$false as parameter values. Current behavior is that -File accumulates passed parameters as strings only.

Fix is to special case this based on discussion with PS-Committee to support $true/$false as parsed values to parameters. Switch values is also supported as currently documented syntax doesn't work.
2017-08-01 14:41:31 -07:00
jeffbi 10a27b891a Increase code coverage of Get-ChildItem on file system. (#4342)
* Increase code coverage of Get-ChildItem on file system.
2017-08-01 13:16:30 -07:00
Steve Lee [MSFT] ec65a466e2 set deviceguard test to pending as it keeps failing in CI 2017-07-31 17:11:45 -07:00
Steve Lee ab764eeac1 Length script property for List View didn't include a name for the property so it defaulted to using the script as the property name (#4437) 2017-07-31 12:56:41 -07:00
Steve Lee 7667f05da7 Fix Invoke-Item test on macOS (#4435)
add defensive measures to have TextEdit start explicitly bypassing restoring previously open docs and to explicitly close TextEdit after the test.
2017-07-31 12:41:32 -07:00
Steve Lee 21f7f36756 Make invoke-item test Feature and increase timeout (#4382) 2017-07-28 17:47:56 -07:00
Travis Plunk 06d416b954 Merge pull request #4353 from SteveL-MSFT/deviceguard-startprocess
Fix DeviceGuard data being returned from Get-ComputerInfo and Start-Process test failure
2017-07-28 14:22:51 -07:00
Ilya 62f2a96cd9 Clean up '#if CORE' in OrderObjectBase.cs (#4371) 2017-07-28 11:29:43 -07:00
SteveL-MSFT 48625af83e added check to device guard not returning array 2017-07-28 11:28:02 -07:00
SteveL-MSFT d78e9ba19b [Feature]
In CI, notepad.exe isn't starting (or starting in time) when using start-process with .txt based on file association.
Since the test is validating opening files by association, fix is to create our own association that is predictable.
2017-07-28 10:58:12 -07:00
Steve Lee 03d4e9120b Support Invoke-Item -Path <folder> (#4262)
On CoreFx, UseShellExecute for Process start is false by default to be cross platform compatible.
In the case of a folder, Process.Start() returns Access Denied as it's not an executable.
On Windows, we can use the ShellExecute path to have explorer open the folder. On Unix, we use `xdg-open` and `open` for Linux and macOS respectively.
2017-07-27 22:17:38 -07:00
SteveL-MSFT 700a1c41ff [Feature]
fix Get-ComputerInfo return of status for DeviceGuard
fix corresponding tests
2017-07-26 15:08:24 -07:00
Steve Lee 0cd7a4a0c9 Fix error message when 'HelpMessage' property of 'ParameterAttribute' is set to empty string (#4334)
- Fix invalid value error message on some properties of ParameterAttribute to point to the specific properties.
- Avoid wrapping argument exception into not a useful 'requires' exception.
2017-07-26 09:20:43 -07:00
Travis Plunk f3dd2f0414 Merge pull request #3608 from DarwinJS/feature/install-powershell.sh
create script to install latest powershell from repositories
2017-07-25 18:48:20 -07:00
Travis Plunk e4dc938732 Get macOS working and fix misc issue 2017-07-25 17:55:42 -07:00
Dongbo Wang 0d8eff6446 Fix array expression to not return null or throw error (#4296)
This change fixes 3 issues:
- According to [PowerShell Language Specification Version 3.0](https://www.microsoft.com/en-us/download/details.aspx?id=36389), as quoted: "_The result is the (possibly empty) unconstrained 1-dimensional array_", `@(...)` should only return `object[]` array.
- `@([object[]]$null).GetType()` fails with error `"You cannot call a method on a null-valued expression."`
- `@([System.Collections.Generic.List[object]]$null)` fails with error `"Object reference not set to an instance of an object."`
2017-07-24 21:52:30 -07:00
Dongbo Wang 905e6978e6 [Feature]Fix regressions that cause implicit remoting tests to fail (#4326) 2017-07-24 08:17:41 -07:00
bergmeister ffd39b2853 PSScriptAnalyzer fixes by category (#4261)
- 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'
2017-07-21 21:03:49 -07:00
Steve Lee e23d2e53d5 Add Test coverage for XmlCommand.cs (#4201) 2017-07-21 13:50:14 -07:00
Travis Plunk f1ff79011d Due to the use of unsupported APIs, we must remove the LocalAccounts module until a better solution is found. (#4302) 2017-07-19 17:20:35 -07:00
Travis Plunk 72a8de39b5 Due to the use of unsupported APIs, we must remove the Counter CmdLets in the Diagnostics Module until a better solution is found. (#4303) 2017-07-19 17:20:01 -07:00
Dongbo Wang d6265c303b Add test to validate 'Assembly.LoadFrom' behavior (#4285) 2017-07-18 22:10:59 -07:00
Mike Richmond 4f13bf476e Fix ConvertTo-Html single matched column header bug (#4276) 2017-07-18 14:13:54 -07:00
Steve Lee b70460fb93 updated webcmdlets CI tests to not depend on external website (#4279)
* 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
2017-07-18 12:33:40 -07:00
Steve Lee 44e377525b Register-PSSessionConfiguration fails if SesionConfig folder doesn't exist (#4271) 2017-07-18 10:07:05 -07:00
Dongbo Wang 069c7a4b6f Enable DataRow/DataRowView adapters in PowerShell Core (#4258) 2017-07-17 11:27:01 -07:00
Dongbo Wang c5f3a19caf Run PowerShell class static methods in the correct Runspace/SessionState (#4209)
Summary
----------
When the same script file gets executed in multiple Runspaces, the RuntimeType generated from the powershell class defined in the file will be shared among those Runspaces. For different Runspaces, different SessionState should be used to run the static methods.

Fix
---
We use the `SessionStateKeeper` to query for the correct `SessionState` to use for a static method call.
We already use `SessionStateKeeper` to track the `Runspace/SessionState` where a PowerShell class is defined, and thus we can leverage this for the static method invocation.
2017-07-14 18:05:48 -07:00
Ilya 23c9b934ef Fix C# tests for ValidateSetValuesGenerator (#4253) 2017-07-14 13:02:58 -07:00
Paul Higinbotham 7fa0dd0549 Fix for implicit remote regression in restricted session (#4222) 2017-07-14 12:28:22 -07:00
Dan Travison ea758a53af Add -SkipHeaderValidation switch to Invoke-WebRequest and Invoke-RestMethod to support adding headers without validating the header value. (#4085)
* Add -SkipHeaderValidation switch to Invoke-WebRequest and Invoke-RestMethod to support adding headers without validating the header value.

* Fix whitespace
2017-07-14 10:24:20 -07:00
David Christian e333ac3ab9 Added tests for built-in type accelerators (#4230) 2017-07-14 09:53:28 -07:00
Paul Higinbotham 02737e2fe4 Fixes CIM deserialization bug (#4234) 2017-07-14 09:52:24 -07:00
Ilya dc76c86f7a ValidateSetAttribute enhancement: support set values to be dynamically generated from a custom ValidateSetValueGenerator (#3784)
Currently `ValidateSetAttribute` accepts only explicit constants as valid values. This is a significant limitation. Sometimes we need to get valid values dynamically, ex., Azure VMs, logged-on users and so on. The PR add follow possibilities:
- pass a _custom type_ (a valid values generator) implementing `IValidateSetValuesGenerator` interface to get valid values dynamically.
- pass a _custom type_ (a valid values generator) derived from `CachedValidValuesGeneratorBase` abstract class to get valid values dynamically and _cache_ the list to share with other ValidateSetAttribute attributes.
2017-07-13 21:28:32 -07:00
Travis Plunk 7d50e5e5b0 Fix maintainer readme syntax (#4226) 2017-07-11 16:15:11 -07:00
Steve Lee db813b6bae add test coverage for -notcontains, -is, -isnot operators (#4179)
* added test coverage for -notcontains, -is, -isnot operators

* cleaned up tests to use -TestCases, added missing -cnotcontains test
2017-07-11 12:27:04 -07:00
jeffbi a9b8e98449 Remove unneeded test hooks and tests due to behavior change in .NET Core (#4200) 2017-07-08 15:18:48 -07:00
Steve Lee 7bce1653f3 Add Windows PowerShell PSModulePath by default on Windows (#4132)
This change is only for Windows and appends the Windows PowerShell PSModulePath on startup via a default profile. Depending on the data/feedback we get, we can decide what to do (opt-in vs opt-out) as we get closer to a release candidate.
2017-07-07 09:43:37 -07:00
Aditya Patwardhan 51c7861da6 Updated Code Coverage badge and filtered out PSReadline module (#4121) 2017-07-07 09:29:23 -07:00
Steve Lee 8f8580a408 Fix usage of -TestCases so that the parameters show up in the test case description (#4188) 2017-07-07 09:25:46 -07:00
jeffbi 1688703caf Make Get-ChildItem follow symlinks on demand, with checks for link loops (#4020)
Add the dynamic parameter `-FollowSymlink` to `Get-ChildItem`.
Add a mechanism for tracking visited directories.
Add native code to get device/inode information on Unix/Windows.
Add warning when refusing to enter an already-visited directory.
2017-07-06 12:28:27 -07:00
Tim Curwick d1e05efbf1 Added comma to the list of replaced characters in assemblyname (#4136) 2017-07-06 11:32:54 -07:00
Steve Lee dda482eaac Add markdown lint errors as test failure message (#4189) 2017-07-05 21:47:42 -07:00
Bruce Payette ece27ff687 Fix spurious error generated when importing cmdlets from an in-memory assembly (#4117) 2017-06-30 15:36:38 -07:00
Dongbo Wang 3e35fb9918 Move powershell to 2.0.0-preview3-25426-01 using the .NET CLI 2.0.0-preview2-006502 (#4144) 2017-06-30 13:07:14 -07:00
Andrew ecefb50d0d Fixing Import-Module on Linux for special cases of NestedModules/RootModule path format (#4010)
* IPMO fix for some cases of NestedModules/RootModule path syntax

* Added tests for #3693 fix

* Updated tests
2017-06-28 16:35:33 -07:00
Steve Lee 042a6f2534 Need explicit -command to execute command in Read-Host output test (#4103) 2017-06-28 10:13:37 -07:00
Keith Hill 27e47f9ee1 Implement Unicode escape parsing (#3958)
* Implement Unicode variable width `u{xxxxxx} escape sequences.
2017-06-27 22:55:57 -07:00
Andrew e2e07b1830 Change New-ModuleManifest encoding to UTF8NoBOM on non-Windows platforms (#3940)
* Change New-ModuleManifest encoding to UTF8NoBOM

* Addressed PR feedback

* Fixed test for Travis CI

* Updated tests
2017-06-27 12:48:25 -07:00
Maria Romero 471f4e8a48 Add tab completion for Export-Counter -FileFormat parameter (#3856)
* add tab completion for -FileFormat parameter

* update expected error for invalid -FileFormat test case
2017-06-25 12:13:57 -07:00
jeffbi 5ee4ec1e1e Make Move-Item work with its -Include, -Exclude, and -Filter parameters (#3878)
* Make Move-Item work with its -Include, -Exclude, and -Filter parameters (#2385)

Invoke the correct overload of SessionState.Path.GetResolvedPSPathFromPSPath, passing the cmdlet context object.

* Update tests per code review.

* Changes per code review.

* Remove stray comment
2017-06-22 19:14:51 -07:00
Aditya Patwardhan 7491417bf9 Fixed BaseDirectory tests by adding -c instead of positional argument (#4078) 2017-06-22 13:35:04 -07:00
Staffan Gustafsson b65bc62934 Add type inference for Foreach-Object -MemberName (#3972)
This PR adds type inference support for the 'MemberName' parameterset for Foreach-Object.

Both of the following should work:

```
    Get-Process | % {$_.MainModule} | % Com<Tab>
    Get-Process | % MainModule | % Com<Tab>
```

Before this change, only the first line worked, this PR addresses the second line.

Fixes #2596
2017-06-22 13:34:33 -07:00
Aditya Patwardhan c7b959bd6e Make CodeCoverage tests work with CodeCov.io and related fixes (#4050)
* Fixed OpenCover module and CodeCoverage launcher script

* Changes to layout of package caused some changes to package path.
* Added Test modules from tests\tools\modules
* Fixed Get-ChildItem test
* Added convertor for converting OpenCover output file to JSON.
* Updated how the file is uploaded to CodeCov.io

* Addressed code review comments
2017-06-21 19:20:10 -07:00
Steve Lee 18cddc99eb with change of positional parameter to powershell.exe from -command to -file, need to update some feature tests (#4058) 2017-06-21 18:47:56 -07:00
Travis Plunk 5a84e60c13 Remove nightly docker images (#4052) 2017-06-20 10:42:26 -07:00
Steve Lee 3543498ee3 Adding a slightly bigger window to 'Start-Sleep' test. (#4049) 2017-06-20 09:49:49 -07:00
jeffbi 06dfe41e7d Enable Send-MailMessage on CoreCLR (#3869)
* Enable Send-MailMessage for PowerShell Core
* Update cmdlet entry in DefaultCommands.Tests.ps1
* Changes per code review:
  * Add check for SMTP server
  * Send mail to/from currently logged-in user on currently-named machine
  * Do not try to clear/create the mailbox before the test
  * Add validation of Subject
2017-06-19 18:19:25 -07:00
Ilya f30b06fe7c Add 'CSharpVersion7' member into public 'Language' enum (#3933)
Public enum 'LanguageVersion' from 'Microsoft.CodeAnalysis.CSharp'
already contains 'CSharp7' member.
After moving PowerShell to .Net Core 2.0 we should add 'CSharpVersion7'
member into public 'Microsoft.PowerShell.Commands.Language' enum too.

This will allow 'Add-Type -Language CSharpVersion7'
2017-06-19 18:09:15 -07:00
Steve Lee a66cd0b620 Remove ClrVersion property from $PSVersionTable (#4027)
* ClrVersion property of $PSVersionTable is not useful with CoreCLR and end users should not be using it
that value to determine compatibility.  Recommendation from dotnet team is to remove that property.

* Removed internal members used for CLRVersion

* removed CLRVersion from FullCLR build as well

* added additional information to run `start-psbootstrap -buildnative` if cmake is not found
2017-06-19 15:10:36 -07:00
Steve Lee 41f65de57c Change positional parameter for powershell.exe from -Command to -File (#4019)
Previously powershell.exe treated unknown arguments as a command line to execute. To align with POSIX so that things like shebang scripts work correctly, we are changing powershell.exe so that it treats unknown arguments (aka positional argument) as a file. This means that `powershell foo` will now attempt to use `foo` as a PowerShell script whereas previously `foo` would be treated as a command to execute. This doesn't affect existing usage of either -File nor -Command. Fixed tests that didn't explicitly use -Command parameter.
2017-06-19 12:17:56 -07:00
Tadas Medisauskas 437d773597 Start-Sleep: add 'ms' alias to '-Milliseconds' (#4039) 2017-06-19 12:15:31 -07:00
Aditya Patwardhan 2ae5d071ce Fix about_* topic help issues and a few tab completion regressions (#4014) 2017-06-18 18:27:34 -07:00
Dongbo Wang b4973fc920 Move PowerShell back to .NET Core 2.0.0-preview1-002106-00 (#4026) 2017-06-15 16:29:25 -07:00
Dan Travison 039ed6764d Strip authorization header on redirects with web cmdlets (#3885)
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
2017-06-15 15:52:08 -07:00
Aditya Patwardhan 26a44abcec Added logic in AssemblyLoadContext to load assembly from GAC. (#3981) 2017-06-15 13:25:59 -07:00
Dongbo Wang 440590ef8a Add a test for chaining more than 2 native commands in pipeline (#4012) 2017-06-14 16:50:18 -07:00
Dongbo Wang 8731747c3e Move to latest .NET Core and enable -SkipCertificateCheck on OSX (#3887) 2017-06-13 17:58:20 -07:00
Steve Lee ea0082ab8d Consolidated the two test exes into one (#3982)
Combined the previous echoargs and createchildprocess test exes into a single TestExe that can be extended for other tests.
2017-06-13 17:49:56 -07:00
Chunqing Chen 65f96e0298 Fix the issue that PS only stops transcription when all runspaces are closed (#3896)
Only stop transcription when all runspaces are closed
2017-06-13 15:44:06 -07:00
Steve Lee af0600ded2 Fix non-fatal (red) errors in test output (#3968) 2017-06-09 16:29:59 -07:00
James Truher [MSFT] bc807322ed Alter test httplistener to use a new runspace rather than a job (#3966)
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.
2017-06-09 10:12:46 -07:00
Dongbo Wang 7a51b446e5 Support creating PS class instance that is not bound to any runspace (#3871) 2017-06-07 18:00:03 -07:00
jeffbi ce4c35b9ed Allow use of long paths (#3960)
When calling Windows native API to determine if an item exists,
ensure the path is prepended with "\\?\" when the path is a long path.

Fixes #3891
2017-06-07 17:13:51 -07:00
Staffan Gustafsson 3125764476 Fix bug where native.exe --<tab> would not call native completer (#3633) 2017-06-07 16:34:44 -07:00
Staffan Gustafsson a52adcd3cf Adding support for Typeinference based on runtime variable values (#2744)
* Refactored the type inference code in preparation to make it a public api.
* Added type inference tests

Fixes #2567
2017-06-07 15:52:33 -07:00
Chunqing Chen 751dadab08 Fix the issue Get-Help does not support string pattern under Unix (#3852) 2017-06-06 18:06:51 -07:00
Aditya Patwardhan 73548532bc Fixed code coverage infrastructure and some failing tests (#3914)
Fixed tests that were failing or throwing unnecessary information on-screen.
Updated the paths to powershell.exe as per the new artifact layout.
Added Publish-PSTestTools to Compress-TestContent
Added PS Test tools to PSModulePath before starting tests.
2017-06-05 17:37:48 -07:00
Andrew 28ec9a3511 Fix Import-Module to honor 'ScriptsToProcess' when '-Version' is specified (#3897) 2017-06-05 14:19:03 -07:00
Ilya 9c42d2d030 Remove BuildVersion from $PSVersionTable (#3877)
* Remove BuildVersion from PSVersionInfo type

* Fix error messages

* Remove BuildVersion from tests
2017-06-01 15:56:28 -07:00
Steve Lee 00a11d9201 On Mac, when the httplistener is stopped, it takes time for the system to clean it up. It also appears that on Mac, http reservation (#3872)
Use different HttpListener for Invoke-WebRequest and Invoke-RestMethod tests
2017-05-31 15:56:32 -07:00
Steve Lee bf59075a0c Fix daily test failure in set-content test (#3884) 2017-05-30 14:20:18 -07:00
jeffbi c29bd7d684 Make Get-ChildItem continue enumeration when encountering error on contained item (#3806)
Added try/catch within the enumeration loop to allow the enumeration to continue after encountering an error such as an item within the directory being deleted or renamed.

To assist in testing, two new internal test hooks have been added which cause Get-ChildItem to either delete or rename a specific file (file name hard-coded) when encountered during enumeration.
2017-05-25 17:24:47 -07:00
Francisco Gamino 7aa7f3858c Make ConvertFrom-Json deserialize an array of objects with multiple lines. (#3823)
* Fixing ConvertFrom-Json on CoreCLR to be able to handle a collection of strings which represent a JSON content.

* Adding test case for ConvertFrom-Json to process an array of PSObjects as a single string.
2017-05-25 13:00:51 -07:00
Steve Lee 40446c80a7 Support Link Header pagination in WebCmdlets (#3828)
* 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
2017-05-24 15:54:02 -07:00