Commit graph

1202 commits

Author SHA1 Message Date
Dongbo Wang befc5f8ae1 Make PowerShell Core enumerate COM collections (#4553)
Make PowerShell Core enumerate COM collections
2017-08-17 20:23:36 +04:00
Ilya 45d1d20500 Merge pull request #4573 from SteveL-MSFT/console-no
* Make invalid arg to -File consistent with -Command
Improve error message if ambiguous arg is passed to -File

* Update powershell console exit codes to match Unix standards

* Enable -WindowStyle to work
2017-08-17 07:34:02 +04:00
Dongbo Wang b3e7fd374f Move to the official .NET Core 2.0 (#4603)
* Migrate to official .NET Core 2.0

* [Feature] Remove chmod code as the issue has been fixed in dotnet
2017-08-16 17:32:46 -07:00
James Truher [MSFT] 0d1e1919f2 Improve test coverage for CDXML cmdlet infrastructure (#4537)
Create custom CIM classes (via MOF) and CDXML cmdlets against the new CIM class
Create tests for CRUD operations for CDXML cmdlets
Coverage for Microsoft.PowerShell.Cmdletization namespace is nearly 50%
2017-08-16 16:33:53 -07:00
Dan Travison 75a294993c In Web CmdLets, Use HTML meta charset attribute value, if present (#4338)
* Use HTML meta charset attribute value, if present, when the Context-Type header does not specify it.
2017-08-16 16:25:16 -07:00
Maria Romero ea77b57966 Update Format-Hex tests to include -TestCase parameter (#3800)
* update tests to include -TestCase paramater in It block

* Move test functions to appropriate context blocks

* combine skipTest conditions

* move skipTest to Describe block

* correct typo, change to MatchExactly
2017-08-16 15:50:33 -07:00
Steve Lee [MSFT] 26f7db720c Enable -WindowStyle to work 2017-08-16 15:04:34 -07:00
Steve Lee [MSFT] 4c22b10a38 Update powershell console exit codes to match Unix standards 2017-08-16 15:04:03 -07:00
Steve Lee feed7004c7 added tests for primitive types, dictionary type, and enumerable type for convertto-xml (#4503)
* added tests for primitive types, dictionary type, and enumerable type

* address PR feedback
2017-08-16 12:13:07 -07:00
Dongbo Wang feeb8e1d25 [Feature] Clean up FullCLR related scripts/docs (#4580) 2017-08-16 12:07:45 -07:00
Kirk Munro 02c4d34380 Add support for converting enums as strings in JSON (#4318)
* converting enums as strings support

* removed !CORECLR code per @SteveL-MSFT's request
2017-08-16 09:57:30 -07:00
Dongbo Wang a648d4dd9c Add more tab completion tests (#4560)
* Add tab completion tests for CompletionAnalysis.cs

* Minor fixes

* Address comment

* Address one more comment
2017-08-15 09:49:48 -07:00
Aditya Patwardhan b953ab126d Opencover and Code coverage improvements (#4550) 2017-08-14 10:40:11 -07:00
Steve Lee 7b8c6e7f54 fix intermittent failures in filesystem tests (#4566) 2017-08-14 08:53:04 -07:00
Ilya 813e4a661a Fix unblock read only file (#4395)
Adds a new non-terminating error when a file is read-only
2017-08-14 08:49:38 -07:00
Dongbo Wang e83fcca277 Reorganize some engine tests to make it clean (#4551)
1. The individual test files (.ps1) in `/test/powershell/engine` are moved to the corresponding subfolders.
2. The test asset file `test/powershell/Common/TestTypeFile.ps1xml` is moved to `test/powershell/Common/engine/Api/assets/` so that it's next to the test that is using the file.
2017-08-14 13:49:28 +04:00
Manikyam Bavandla 0bfee35525 Add an additional acceptance test for the PowerShellGet module (#4531)
* Add an additional acceptance test for the PowerShellGet module

* Removed 'BVT' tag
2017-08-10 13:33:25 -07:00
Dongbo Wang 384a9fe3fc Clean up ShellExecute code to use the .NET Core implementation (#4523)
* Clean up ShellExecuteHelper and enable ShellExecute in NativeCommandProcessor

* Minor fix

* [Feature] Fix NativeCommandProcessor to clean up in case an exception is thron

* [Feature] Update tests

* [Feature] Address comments

* address one more comment

* Address some more comments
2017-08-10 13:32:57 -07:00
Dongbo Wang 7762d7bf49 clean up map.json related files and scripts (#4532)
* clean up map.json related files and scripts

* Update .spelling
2017-08-10 13:32:19 -07:00
Steve Lee eea3885242 Enable WSManCredSSP cmdlets (#4336)
* [Feature]
Fixed error message using a null resourcemanager
With most recent CoreFx supporting STA, removed special CoreClr code paths
Added test coverage
Removed some dead commented out code that was never used

* [Feature]
merged tests to one file, use runas to have relevant tests run as non-elevated

* [Feature]
Get-CredSSP returns text so only run that test if current culture is en-US

* [Feature] Update test to fix code exclusion

* [Feature] Fix Skipping on test cases that already had a Skip value
2017-08-10 13:31:54 -07:00
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
Dongbo Wang 99f9ef22d2 Fix "Invoke-Item" to accept a file path with spaces on Unix platforms (#3850)
Use the method NativeCommandParameterBinder.NeedQuotes, which is used by powershell native command processor, to check if quotes are needed. If yes, add quotes in the same way as our native command processor.
Also, make 'Invoke-Item' on Linux and OSX able to invoke an executable properly.
2017-05-24 13:30:54 -07:00
Travis Plunk 684e06eb11 Make DocumentEncryptionCert test pending (#3854) 2017-05-24 12:22:17 -07:00
Ilya a02d129cc4 Change to not expose unsupported aliases/cmdlets in Unix (#3595)
Make changes to not expose the aliases "gin", "gsv", "sasv" and "spsv" in Unix platforms.
Also refactored aliases related tests and added new tests covering the complete list of built-in aliases/cmdlets.
2017-05-23 10:27:31 -07:00
Travis Plunk 3496136999 Remove undocumented certificate Win32 APIs (#3818)
The code paths deleted where using the undocumented Win32 APIs on WIn8 and newer for the following purposes:
* Faster filtering
* Getting two properties (left empty on Win7 and below)
* Logging using Certificate components when a cert is deleted or copied.

After the change, all the code uses public APIs.  Filtering is done in PowerShell using existing code.  I don't believe the logging is needed.
2017-05-22 22:33:51 -07:00
Aditya Patwardhan f20178275a Removed 'Import-Module $helperModule' as it is not needed. (#3814) 2017-05-19 10:42:20 -07:00
Bruce Payette dfb3866c5d Support backgrounding pipelines with ampersand (#3360)
Implements support for backgrounding pipelines with &. Putting & at the end of a pipeline will cause the pipeline
to be run as a PowerShell job. When a pipeline is backgrounded a job object is returned. Once the pipeline is
running as a job, all of the normal job cmdlets can be used to manage the job. Variables (ignoring process-specific
variables) used in the pipeline are automatically copied to the job so
    copy $foo $bar &
just works. The job is also run in the current directory instead of the user's home directory as is the case with Start-Job.Implement
2017-05-18 19:15:19 -07:00
Steve Lee f0b03bc57d Test HttpListener so that PowerShell Core tests don't have to rely on an internet web service (#3778) 2017-05-18 15:02:19 -07:00
Ilya e00161a8af Add autoload for TestLanguage.psm1 TestHelpers.psm1 (#3456)
* Add autoload for TestHelpers.psm1

Test.Helpers.psm1 was renamed to TestHelpers.psm1

* Resolve conflit and rebase Add autoload for TestLanguage.psm1

* Remove unneeded comments from PSD1 files

* Rename test modules

Remove approved verbs (Get-Verb) from module names.

* Enhance ShouldBeErrorId to output exception into pipeline for later analysis

* Remove unneeded comments

* Resolve merge conflict
2017-05-17 11:09:27 -07:00
Michael Klement 30b97a5d7c Fix for #3786 (#3793)
The appropriate [SemanticVersion] constructor now accepts a [version] instance that has only major and minor components specified, in which case the patch component now defaults to 0.
2017-05-16 17:10:03 -07:00
jeffbi ee1a897f91 Prevent Get-ChildItem from recursing into symlinks (#3780)
Brings the Get-ChildItem more in line with the Unix ls -r and the Windows DIR /S native commands. Like these commands, the cmdlet will display symbolic links to directories found during recursion but will not recurse into them.
Like the Unix ls command---and unlike the Windows DIR /S command--- the cmdlet will recurse into symlinks given on the command line.
2017-05-15 14:09:46 -07:00
Aditya Patwardhan 89638a814e Enable Get-TimeZone for Unix platforms since required classes are available in .Net Standard 2.0. (#3735) 2017-05-11 16:27:52 -07:00
Steve Lee 63429445f9 Relax SemanticVersion constructors to not require minor and patch (#3696)
`$psversiontable.psversion -gt "3.0"` which is used by PowerShellGet to determine if a module is compatible with the current version of PowerShell.

Change is to allow specifying only major or major+minor where the missing segments default to zero by providing overloaded constructors and allow
the string parsing method to not require major, minor, and patch segments to all be specified (only major is required).

Based on the [response](https://github.com/mojombo/semver/issues/368) from the maintainer of semver, there is no requirement to have strict
conformance for the inputs to the constructor and allowing "3.0" to result in a semver of 3.0.0 is reasonable.
2017-05-08 10:44:40 -07:00
Staffan Gustafsson 8d744f2517 Use '<id> - <name>' as ToolTip and ListItemText when tab completing process ID (#3664) 2017-05-05 18:05:21 -07:00
jeffbi 938e13602b Change error message when using New-Item to create a symlink and the item exists (#3703) 2017-05-05 10:09:34 -07:00
jeffbi 3e416fb642 Change Get-ChildItem to list the content of a link to a directory on Unix. (#3697)
Brings Get-ChildItem in line with ls command on Unix and with the PowerShell behavior on Windows when the link is a directory symbolic link.
2017-05-04 18:00:13 -07:00
Ilya 42cb8ba643 Move 'PSVersion' and 'PSEdition' to first and second places in $PSVersionTable (#3562) 2017-05-03 21:33:52 -07:00
James Truher [MSFT] 563806c15d Change native execution tests to use df instead of stty (#3685)
when automating test execution, some environments don't have a tty which causes
the tests to fail. df is just as good a test as stty as it is also guaranteed to be
present. This change also allows the tests to be run on OSX
2017-05-02 18:45:35 -07:00
jeffbi 2a739afa9c Fix Rename-Item to allow Unix globbing patterns in paths (#2799) (#3661)
* Fix Rename-Item to allow Unix globbing patterns in -Literal paths (#2799)

In the process of normalizing a relative path, PowerShell checks to see
see if the path exists, which it does by invoking
    Directory.EnumerateFiles(directory, filename);

On Unix platforms, if the filename contains globbing patterns, such as [ab],
EnumerateFiles (and EnumerateDirectories) will perform the globbing. Using
globbing patterns, a file named 'file[txt].txt' is reported as not existing.

This fix changes the file-existence test on Unix to use a native function
instead of either of the Directory.EnumerateXXX functions.

* Fix for AppVeyor failure

* Changes per code review, and a couple of letter-casing changes.
2017-05-02 18:42:16 -07:00
Ilya 3d7ef43498 Improve ValidateCount attribute error message (#3656)
Leave only two message for ValidateCount attribute error:
1. Count is not in allowed range.
2. Count is not exactly equal allowed value.
2017-05-02 10:04:52 -07:00
Chunqing Chen 9051ca1fbc PSVersionTable should have entry for OS and Platform (#3654) 2017-05-01 21:04:49 -07:00
Chunqing Chen 5a82b10fc7 Get-Help should find help files under pshome (#3528) 2017-05-01 13:54:01 -07:00
Bruce Payette 11ad02a15a Adding support for native command globbing on UNIX (#3643)
This change enables globbing (wildcard expansion) against the file system for native commands like '/bin/ls'. The expansion is only done in the file system. In non-filesystem drives expansion is not done and the pattern is returned unchanged.

Limitations of the fix:
Currently quoting is not honored so for a command like /bin/ls "*.txt", wildcard expansion will still be done. Adding support for bare word detection will come in a future PR. Use --% to suppress wildcard expansion e.g. git add --% *
2017-05-01 12:23:36 -07:00
Andrew c0aafdb3d0 Fixing a bug related to ModuleSpec syntax in RequiredModules (#3594)
This fixes issue #2607.
'RequiredModules' is a field in module manifest that can reference other modules using ModuleSpecification format.
The basic version of this format (just module name) was working fine, however, there was a problem when a more detailed version of the format was used (the one that uses module versions or/and GUIDs).
During module import, there is a check for cyclic references through 'RequiredModules' field. The bug was in this check for cyclic references, related to comparison rules for ModuleSpecification objects - as a result, the code was incorrectly reporting 'cyclic reference' error in cases when there was none.
Also, added tests for different ModuleSpecification formats and a test for error when there is actually a cyclic reference.
2017-04-30 17:58:44 -07:00
Dongbo Wang 08e855556c Mark '-SkipCertificateCheck' tests pending on OSX for now (#3660)
Mark two tests pending on OSX due to #3648
2017-04-27 18:15:59 -07:00
jeffbi f1769fe7a8 Change behavior of Remove-Item on symbolic links (#621) (#3637)
When 'Remove-Item' is used to remove a symbolic link in Windows, only the link itself is removed. The '-Force' switch is no longer required.
If the directory pointed to by the link has child items, the cmdlet no longer prompts the user to remove the child items---those child items are not removed. The '-Recurse' switch, if given, is ignored.
This brings 'Remove-Item' more in line with the behavior of the 'rm' command on Unix.
2017-04-27 17:47:24 -07:00
Lee Spottiswood 1d42862e21 Adds Port parameter for SSH PSSessions (#3499)
* fixes summary block typo

* Adds support for Port parameter for SSH PSSessions

* Reverted back to master, modified based on PR feedback

* Update exception message

* remove unused line

* Add existing constructor back in as to not break public contract

* remove port check

* pass nested inner exception straight to Should

* dispose runspace after each test

* Add SSHHostParameterSet attribute for Invoke-Command Port property

* Update ParseSSHConnectionHashTable method to accept Port value as integer

* Add helper method for validating port in range. Refactor port parameter constructor overload to use original constructor

* rename method

* Adds GetSSHConnectionStringParameter and GetSSHConnectionIntParameter methods for retrieving SSHConnection hashtable values

* Adds method comments

* Adds helper method comment

* Change methods to add C# 7 patterns
2017-04-25 18:02:16 -07:00
Steve Lee ee9049b61f New-ModuleManifest was incorrectly checking if a Uri was well formed by using ToString() which just outputs the original (#3631)
string.  If the string was a uri with spaces, ToString() doesn't return the escaped version.  The AbsoluteUri property
should be used instead which returns an escaped absolute uri (if valid).

Also renamed TestModuleManfest.ps1 to TestModuleManifest.Tests.ps1 so that it gets picked up correctly as Pester test.

Since HelpInfoUri is just a string, ensure it is a valid absolute uri and escaped correctly whereas before it was just
an opaque string that wasn't validated.
2017-04-25 17:45:24 -07:00
David Christian f8f603ada6 Added tests for Test Connection (#3604) 2017-04-25 09:53:17 -07:00
Staffan Gustafsson 5bdcff5ad9 Fix tab completion with '@{<tab>' to avoid crash in PSReadline (#3626) 2017-04-25 09:42:43 -07:00
Staffan Gustafsson f959c41e71 Add Hashtable tab completion for -Property of select-object (#3625)
Also added more tab completion tests.
2017-04-24 16:45:05 -07:00
Ilya e8ec40069b Improve ValidateCount attribute error message (#3596) 2017-04-21 18:01:04 -07:00
James Truher [MSFT] 63c20f15b1 Add dockerfile and test so we can test simple remoting behaviors (#3470)
* Add dockerfile and test so we can test simple remoting behaviors

this docker file creates an image which can be used to test remoting with containers.
We start with the microsoft/windowsservercore image and then set up the system for
testing by adding a user, setting up configuration for basic auth, installing
PowerShell Core, and creating a configuration endpoint for PSCore.

The tests are very simple; it retrieve $PSVersionTable.PSVersion in the following
connections:
   Full -> Full
   Full -> Core
   Core -> Full
   Core -> Core

* Add new file to bootstrap the docker image

fix the tests to be more resilient to changes in the version of the PSCore package

* update script to use local user cmdlets rather than net.exe

also remove pscore.msi at the end of the image build process to save space

* clean up commented lines and remove an unused parameter from one of the functions

also use constants more consistently

* remove reference to docker image name by string and use variable instead.
2017-04-21 17:23:08 -07:00
jeffbi 8183732d99 Use more accurate test to check if source and destination paths are pointing the same file (#3441)
Rather than relying on case-insensitive string compares of source and destination paths, use operating system calls to determine whether two paths refer to the same file. This solves not only the case-insensitivity issue but also allows the cmdlet to operate properly if the destination is a hard or symbolic link to the source.
The Windows side is implemented in C#. The Unix side is implemented partially in native code.
2017-04-21 16:09:53 -07:00
Dongbo Wang dc6b91a672 Fix the Read-Host test that fails in OSX (#3609) 2017-04-20 15:12:31 -07:00
Staffan Gustafsson fa901b646f Add ErrorMessage property to ValidatePattern, ValidateSet and ValidateScript attributes (#2728)
This makes it possibe to write for example
[ValidatePattern('[A-Z]:',  ErrorMessage='The Drive should be specified as a single letter followed by a colon, for example "D:"')]
[string] $Drive,

The element being validated is also passed, so {0} can be used in the custom error message
2017-04-20 11:31:57 -07:00
Dongbo Wang e8a0f3ca63 Fix web cmdlet tests and the error message for 'Get-Member -input $null' (#3602) 2017-04-19 18:20:45 -07:00
Chunqing Chen e3d4c95a77 New-Item -ItemType SymbolicLink cannot understand directory path ending with slash on Linux (#2974) 2017-04-18 15:40:25 -07:00
Dongbo Wang 7a55bf98b2 Move powershell to .NET Core 2.0 (#3556)
This change moves powershell to .NET Core 2.0. Major changes are:
1. PowerShell assemblies are now targeting `netcoreapp2.0`. We are using `microsoft.netcore.app-2.0.0-preview1-001913-00`, which is from dotnet-core build 4/4/17. We cannot target `netstandard2.0` because the packages `System.Reflection.Emit` and `System.Reflection.Emit.Lightweight`, which are needed for powershell class, cannot be referenced when targeting `netstandard2.0`.
2. Refactor code to remove most CLR stub types and extension types.
3. Update build scripts to enable CI builds. The `-cache` section is specified to depend on `appveyor.yml`, so the cache will be invalidated if `appveyor.yml` is changed.
4. Ship `netcoreapp` reference assemblies with powershell to fix the issues in `Add-Type` (#2764). By default `Add-Type` will reference all those reference assemblies when compiling C# code. If `-ReferenceAssembly` is specified, then we search reference assemblies first, then the framework runtime assemblies, and lastly the loaded assemblies (possibly a third-party one that was already loaded).
5. `dotnet publish` generates executable on Unix platforms, but doesn't set "x" permission and thus it cannot execute. Currently, the "x" permission is set in the build script, `dotnet/cli` issue [#6286](https://github.com/dotnet/cli/issues/6286) is tracking this.
6. Replace the use of some APIs with the ones that take `SecureString`.
7. osx.10.12 is required to update to `netcoreapp2.0` because `dotnet-cli` 2.0.0-preview only works on osx.10.12.
8. Add dependency to `System.ValueTuple` to work around a ambiguous type identity issue in coreclr. The issue is tracked by `dotnet/corefx` [#17797](https://github.com/dotnet/corefx/issues/17797). When moving to newer version of `netcoreapp2.0`, we need to verify if this dependency is still needed.
2017-04-17 11:52:38 -07:00
jeffbi 06020f34e5 Fix New-Item to create correct symlink type (#2915) (#3509)
Now `New-Item` can create a file symlink to a file target or to a non-existent target. It can also create a directory symlink to a directory target on Windows.
2017-04-14 14:23:14 -07:00
Steve Lee 2851f7e800 Accept -i for an interactive shell (#3558)
On Unix, it is a convention for shells to accept `-i` for an interactive shell and many
tools expect this behavior (`script` for example, and when setting powershell as the
default shell) and calls the shell with the `-i` switch.  This change is breaking in
that `-i` previously could be used as short hand to match `-inputformat` which now will
need to be `-in`.
2017-04-13 18:35:26 -07:00
Ilya 4ad4b194fc Convert tab indentations to spaces in *.cs files (#3551)
Prepare to pass meta test.
2017-04-13 13:45:46 -07:00
Ilya acec58c049 Make the output of $PSVersionTable in alphabetical order (#3530) 2017-04-12 22:04:53 -07:00
Travis Plunk 18c28f8fc7 Fix markdown lint issues for SSH Remoting demo and enable related tests (#3484) 2017-04-11 09:42:37 -07:00
Steve Lee 753b1965a0 Fix crash at startup when env:HOME not set (#3437)
There are cases like using PowerShell via Puppet where the account being
used does not have a home directory.  Updated PowerShell to use a process
specific temporary directory if HOME, CONFIG, CACHE, and DATA directories
are not available.  Temporary directory is removed when last runspace
is disposed.
2017-04-09 09:23:06 -07:00
Dongbo Wang 3be547c78e Skip the parser tests that are run by 'ShouldBeParseError' in Travis Full Build (#3479) 2017-04-04 09:23:51 -07:00
Rune Darrud 42f2e3ca82 Fix tests to work as expected under Linux (#3474)
- Removed the -TimeoutSec option and modified the expected Error to be consistent across platforms.
- Changed the port of the phony proxy to 9 which is reserved for the Discard Protocol. So even if the system is listening, it's supposed to discard that TCP request (UDP may use it for Wake-on-Lan, but doesn't affect this).
2017-04-02 17:31:22 -07:00
PetSerAl f76b2fcbaf Make Out-Default -Transcript more robust in how it handles TranscribeOnly state (#3436) 2017-04-01 16:36:04 -07:00
Rune Darrud a770ecd686 Add option -NoProxy to WebCmdlet 2017-03-31 18:02:59 -07:00
Ilya 46cc634854 Fix typo in Scripting.Classes.BasicParsing.Tests.ps1 (#3459) 2017-03-30 08:35:06 -07:00
Travis Plunk 7e5814abf5 Expand md lint tests (#3451) 2017-03-29 17:13:19 -07:00
Ilya c705dbd0a7 Add test to verify approved aliases list (#3380) 2017-03-29 14:53:40 -07:00
Ilya 39be7109d4 Add tab completion for Select-Object -ExcludeProperty -ExpandProperty (#3443) 2017-03-29 10:36:18 -07:00
Ilya 27b27cc43a Autoload TestRemoting.psm1 (#3430) 2017-03-29 10:11:02 -07:00
Steve Lee da2fd5c89f Get-help may return multiple instances of the same help file (#3410)
* Help was incorrectly returning multiple instances of the same help file if it existed under a culture path and the parent was in the search path as well

* updated test to use generated help file rather than an actual one

* Fixed test to have module in $pshome path and casing of en-US culture
2017-03-28 15:07:42 -07:00
Travis Plunk 737058f62e Add markdown lint test (#3420)
* Fix markdown syntax and spelling issues
* update spelling dictionary
2017-03-27 16:44:28 -07:00
Ilya a99fb531e6 Add autoload for test modules (#3342)
Related #3238

1. Add autoload for test modules
2. Move TestHostCS.psm1 to 'test\tools\Modules\' folder
3. Remove explicit load TestHostCS.psm1 from test files
2017-03-26 21:46:39 -07:00
Dongbo Wang 54fa658e31 Migrate from project.json to MSBuild (#3398)
- FullCLR build is disabled in this change.
- FullCLR build related functionalities in `build.psm1` and `AppVeyor.psm1` are disabled. They are not cleaned up from `build.psm1` and `AppVeyor.psm1` yet. We need to adopt .NET Core 2.0 to verify the portable module concept, and if that works well, we will remove the Windows PowerShell source code and clean up our scripts.
- `dnxcore50` and `portable-net5+win8` target framework monikers are removed.
- Dependency on `Microsoft.NETCore.Portable.Compatibility` is removed. It's not necessary, but it may come back when we work on supporting the `portable module`. Its necessity can be reviewed at that time.
- I didn't spend the time to try building powershell in Visual Studio 2017. We should have a separate issue for that. It's tracked by #3400

The `TypeCatalogParser` project is replaced by a MSBuild target to gather the dependency information.
Due to .NET Core SDK issue [#1021](https://github.com/dotnet/sdk/issues/1021), our meta-package project `Microsoft.PowerShell.SDK` starts to generate an empty assembly during the build and that results in an empty assembly `Microsoft.PowerShell.SDK.dll` appear in `publish` folder and in `.deps.json` file. We cannot simply remove the assembly because it's now part of the TPA, and removing it will cause powershell to crash at startup. We have to live with this empty assembly until that .NET Core SDK issue is fixed.  It's tracked by #3401.
2017-03-23 13:04:52 -07:00
Chunqing Chen 1393f45640 Get-Help does not work in JEA sessions (#2988) 2017-03-23 11:30:26 -07:00
Travis Plunk 27c819ce2e Add build support for OpenSUSE 42.1 (#3389) 2017-03-22 14:19:51 -07:00
Sergei Vorobev 0f099ee9be Remove Archive tests 2017-03-22 12:43:38 -07:00
Steve Lee d59a71f82c Changed usage of registry to psdrive instead of type which causes failure on Linux (#3377) 2017-03-21 10:04:46 -07:00
Maria 0e12fbfc9e Implement Format-Hex in C# (#3320) 2017-03-21 09:00:43 -07:00
Steve Lee c624ae2d6c tab expansion not working correctly for some parameters (#3364)
There was off by one error causing an `IndexOutOfRangeException` during parameter name completion.
2017-03-21 08:23:51 -07:00
jeffbi bbba61c1f5 Update Get-ComputerInfo test to properly test DeviceGuard items. (#3339)
* Make Get-ComputerInfo tests handle the case of the root\Microsoft\Windows\DeviceGuard namespace not found on the test machine.

Catch CIM exceptions, but don't look specifically for namespace-not-found

* Update Get-ComputerInfo test to properly test DeviceGuard items.
2017-03-17 16:31:21 -07:00
Dongbo Wang 3a21d4c3df Search the assembly cache kept by ExecutionContext for type resolution. (#3327)
Our assembly cache contains assemblies that are explicitly loaded by powershell egine, such as via module loading or the assembly entries from InitialSessionState. We should search it before searching all loaded assemblies to give preference to resolve a type against the assemblies contained in the cache, so that in case there is a conflict, we might have a preferred assembly to use for a type resolution.

Changes:
- Search from context.AssemblyCache.Values before search from all loaded assemblies.
- Skip assemblies that we already searched and found no matching type.
- Skip checking PS types kept in the scope and type accelerators when it's not necessary.
2017-03-17 13:19:31 -07:00
Steve Lee df0162b90c put innerexception message as error detail rather than user getting generic error message (#3330) 2017-03-16 17:59:15 -07:00
Chunqing Chen 3f274aad9c make transcripts include the configuration name in the transcript header (#2890)
* PowerShell transcripts should include the configuration name in the transcript header
* adding test case for PowerShell transcripts should include the configuration name in the transcript header #2890
2017-03-15 22:06:07 -07:00
Steve Lee 76de340e79 corrected use of PSModulePath casing to be consistent with Windows PowerShell (#3255)
* corrected use of PSModulePath casing to be consistent with Windows PowerShell
addresses #3227

* addressing review feedback
make "PSModulePath" into const
fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in

* addressing review feedback
make "PSModulePath" into const
fixed some test workarounds due to failures for external reasons that wasn't meant to be checked in
2017-03-15 12:04:28 -07:00
Steve Lee e5da3516d9 fix default folders for opencover, output xml, and powershell exe path (#3308) 2017-03-15 11:55:34 -07:00
Dongbo Wang 7f83c48ca5 Add support to ShellExecute in powershell core when it's running on Windows full SKUs (#3281)
* Add ShellExecute support to PowerShell core on windows full desktop
* Add tests for Start-Process and update existing related tests
2017-03-14 11:11:41 -07:00
Staffan Gustafsson 220eaa1ba7 Adding -Extension and -LeafBase switches to Split-Path (#2721)
* Refactoring ParsePathCommand.cs (SplitPathCommand) for readability
   - Using auto properties when no when there is no logic in getter/setter
   - Removing unused code
   - Removing redundant qualifiers
   - Removing Redundant initializers
* Add -Extension and -Leafbase switches to Split-Path cmdlet
   - Extension and LeafBase are specializations of Leaf, and uses System.IO.Path.GetExtension and System.IO.Path.GetFilenameWithoutExtension to extract parts from the Leaf
* Adding tests for Split-Path -LeafBase and Split-Path -Extension
2017-03-10 22:50:23 -08:00
Travis Plunk 2409a2c7c8 Fix a test when the information object returns a FQDN (#3296) 2017-03-10 16:44:08 -08:00
Paul Higinbotham 7cea291475 Fix Invoke-Command remote debugging test failure in nightly build (#3294) 2017-03-09 20:14:26 -08:00
charub d59627f9ae Fix New-LocalUser cmdlet to roll back user in case of user attributes assignment failure.
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.
2017-03-09 09:25:46 -08:00
Steve Lee 44bd923d22 Fix a test to use the targeted powershell rather than the system installed one (#3286) 2017-03-08 16:38:05 -08:00
Andrew 03b00e6522 Updated tags of automounted drives tests (#3290)
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).
2017-03-08 16:34:39 -08:00
Dongbo Wang 60583b1b73 Fix a CMS test that fails in nightly build.
Add a certificate that cannot be used to encrypt data to verify an error condition.
2017-03-07 13:39:15 -08:00
jeffbi 97be759cc7 Do not reject Windows' reserved device names on non-Windows platforms. (#3252) 2017-03-07 10:29:20 -08:00
Travis Plunk e734d44199 Add OpenSUSE 13.2 build support (#3254) 2017-03-06 17:30:14 -08:00
Paul Higinbotham ba62cf1ea2 Fixed typos that caused test to fail. (#3268) 2017-03-06 17:26:38 -08:00
Andrew 1d1cffd0c5 Auto-mounted file system drives correctly created when mounted inside a module (#3034)
Fixes #2442
2017-03-06 16:26:06 -08:00
Staffan Gustafsson b4049879d4 Adding Parent extended property to System.Diagnostics.Process (#2850) 2017-03-06 15:21:39 -08:00
James Truher [MSFT] c6bd000e6d Add additional tests for Clear-Content to improve coverage (#3157)
Coverage has improved to more than 85% for Clear-Content
2017-03-06 13:57:09 -08:00
Lee303 b043b444db adds parameter sets to web cmdlets to allow for standard and non-stan… (#3142)
* 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
2017-03-06 11:41:14 -08:00
Steve Lee a2687bfb59 Allow profile directory creation failures for Service Account scenarios (#3244)
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
2017-03-05 22:05:10 -08:00
PetSerAl c490e36a58 Remove System.Array type data (#3231)
* Rename Types_Ps1Xml.generated.cs
* Remove <auto-generated> header from Types_Ps1Xml.cs
* Remove System.Array type data
* Update `Get-TypeData` tests
2017-03-01 12:58:03 -08:00
Dongbo Wang fc30ae1d87 Port CmsMessage cmdlets and Get-PfxCertificate to powershell core (#3224) 2017-03-01 10:51:19 -08:00
Steve Lee 99d696f31f Fix Test-Modulemanifest to normalize paths correctly before validating (#3097)
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
2017-03-01 10:36:02 -08:00
Paul Higinbotham b4cb5e95a2 Implementation for Invoke-Command step-in remote debugging (#3015)
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.
2017-03-01 10:28:25 -08:00
PetSerAl ae37a9fafe Fix powershell to not crash on converting recursive array to bool (#3208) 2017-02-27 10:54:07 -08:00
Staffan Gustafsson e3b59e0f51 Moving Import-PowerShellDatafile from script to cmdlet (#2750) 2017-02-26 16:50:28 -08:00
Steve Lee c74b2a7670 return HTTP response for error status as part of exception (#3201) 2017-02-24 22:29:11 -08:00
Kitt Holland d69193e49c Prettier formatting for ConvertTo-Json output. #2736 (#2787)
* 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
2017-02-24 14:40:11 -08:00
Dongbo Wang 8b8d20d56b Work around the hang issue that happens when running class basic parsing tests (#3191) 2017-02-23 13:05:09 -08:00
James Truher [MSFT] 9e27f4a64c Implement -version parameter in console host (address part of https:/… (#3115)
* 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.
2017-02-23 09:36:50 -08:00
Dongbo Wang 16ff1978e1 Fix casting single element array to generic collection (#3170) 2017-02-22 23:10:06 -08:00
jeffbi a557c03570 Provide additional tests for the *-Job cmdlets (#3110) 2017-02-22 08:46:27 -08:00
Ilya e10cbff354 Add ShouldProcess to New-FileCatalog and Test-FileCatalog (#3074)
* 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
2017-02-17 16:32:58 -08:00
Ilya 88c8be75f2 Get-ComputerInfo - fix typo in property name (#3167) 2017-02-17 13:10:51 -08:00
Dongbo Wang 5a8fa57278 Fix PSModuleInfo.CaptureLocals to not do ValidateAttribute check when capturing variables from the caller's scope (#3149)
Fix PSModuleInfo.CaptureLocals to not do ValidateAttribute check when capturing variables from the caller's scope
2017-02-16 21:25:23 -08:00
Paul Higinbotham c266c8ebca Fix for duplicate types in TypeTable (#3141)
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.
2017-02-16 16:28:29 -08:00
Ilya 409ab7443f Fix GetType() bad pattern and related issues in tests (#3134)
* 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.
2017-02-15 16:40:51 -08:00
James Truher [MSFT] d801b75d35 Remove async tests for parser (#3119)
* 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
2017-02-15 16:39:30 -08:00
Ilya fd70adbc90 Improve console cmdlets tests (#3101)
* 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
2017-02-14 11:00:03 -08:00
Paul Higinbotham ca12001c8d Implement RoleDefinitions RoleCapabilityFiles keyword (#3067)
* Changes to implement remote endpoint RoleDefinition RoleCapabilityFiles keyword
* Fixed spelling error.  Added back missing resource string
* Updated tests from CR comments
* Simplified error tests per Code Review
* Test change from Code Review
2017-02-14 10:42:17 -08:00
Ilya a16fead0a5 Fix error position reporting on classes (#3103)
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.
2017-02-13 16:45:00 -08:00
Andrew Gaspar ca5fc9c5a8 Fix tab completion of native parameters (#2919)
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.
2017-02-13 16:02:56 -08:00
Ilya aa764dd54e Small typo in archive cmdlets tests (#3121)
* Small typo in archive cmdlets tests
* Add  -ErrorAction SilentlyContinue
2017-02-10 13:39:34 -08:00
Ilya b22369e2be Make small optimization in parser tests (#3072)
* Make small optimization in parser tests

* Add Clear() for common command
Remove commands from AfterEach

* Refactoring test 'functions are resolved before cmdlets'
2017-02-08 17:42:44 -08:00
James Truher [MSFT] 5871e1ac4b Provide class level coverage data via OpenCover module (#3088) 2017-02-06 23:04:45 -08:00
Ilya 29818062e8 Convert Get-FileHash to a cmdlet (#3024) 2017-02-03 18:11:57 -08:00
Sergei Vorobev 8517b8dafb Mark Write-Information test as pending on macOS 2017-02-03 09:27:35 -08:00
Francisco Gamino f57f924caf Adding '$pshome/cultureName/default.help.txt' to PowerShell Windows Core project. (#3032)
* 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.
2017-02-01 17:56:52 -08:00
Sergei Vorobev 9750297ce3 Add 'osx.10.12-x64' runtime to project.json files 2017-02-01 17:52:35 -08:00
Aditya Patwardhan a69116db05 Fix GetComputerInfo test for looking up registry (#3065)
* Fix GetComputerInfo test for looking up registry

* Addressed code review comments
2017-02-01 17:49:33 -08:00
Aditya Patwardhan 8303a2b3fb Fix get-help online test (#3051)
Fix the "get-help -online" test using a workaround so that when a default browser is not set, the test does not fail.
2017-02-01 17:19:55 -08:00
Aditya Patwardhan 9ab8c6df4c Make OpenCover merge and upload more reliable/usable (#3078)
* 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
2017-02-01 15:45:03 -08:00
Francisco Gamino 89a5c17d6b Fixing 'InFile parameter of Invoke-WebRequest doesn't work' and adding aliases (iwr for invoke-webrequest and irm for invoke-restmethod) to the web cmdlets. (#2848)
* 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
2017-02-01 10:14:24 -08:00
Aditya Patwardhan d7cf81b64d Added functionality to improve failure triaging (#3037)
* 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
2017-01-27 09:40:18 -08:00
Noutlaw1 edf685dc9c Added alias (Path) to the FilePath parameter of the Out-File cmdlet. (#2945)
* 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
2017-01-26 14:17:40 -08:00
Ilya abc3614919 Get-Help test reported as skipped if not applicable to the platform (#3009)
Addressed #2887
2017-01-24 18:04:44 -08:00
Mike Richmond f2b9f7d5ab Add WindowsUBR to Get-ComputerInfo (#2995) 2017-01-23 13:07:38 -08:00
Ilya cba1c26bf0 Fix typo in Unblock-File test (#3025) 2017-01-23 11:43:38 -08:00
Naadir Jeewa 01dfb88e4d Initial Support for Fedora 24 (#2738)
* 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
2017-01-20 11:05:24 -08:00
iSazonov f0a95814d5 Add Unblock-File tests 2017-01-17 17:08:29 -08:00
Ilya 9b23e1e1fe Fix error handling in parsing 'using' statement (#3007) 2017-01-17 12:54:43 -08:00
Jason Shirk 02b5f357a2 Remove trailing whitespace (#3001) 2017-01-16 13:31:14 -08:00
Sergei Vorobev f4f576c92b Rename Wait-CompleteExecution to Wait-UntilTrue 2017-01-12 14:25:07 -08:00
Sergei Vorobev 684a25b9ea Fix Wait-CompleteExecution usage 2017-01-12 14:25:07 -08:00
Sergei Vorobev fab25c5d50 Remove -Force from Import-Module in tests 2017-01-12 14:25:07 -08:00