Commit graph

1115 commits

Author SHA1 Message Date
Dongbo Wang f7bab36f5d Fix the prerequisite check of MSI package (#5070)
* Skip check 'vsruntime140.dll' on Win10

* Make the precheck accurate

* Update windows installation prerequisites

* Change 'higher' to 'above'

* Address comments

* Address more comments

* Address some more comments

* [Feature] Update the installer test
2017-10-10 16:40:07 -07:00
David Weber aea561f08d Add better error message for empty and null -UFormat arg (#5055)
Add better error message for empty and null -UFormat arg
2017-10-10 07:19:02 +04:00
Steve Lee 90165fc17c enable using filesystem from a UNC location (#4998)
* enable using filesystem from a UNC location

* [feature]
address PR feedback

* [feature]
removed changed in NavigationProviderBase and made change in FileSystemProvider where it should belong

* added variations of tests for set-location and push-location
no need to run [feature] anymore since it passed previously and the test case added is CI

* [feature]
move code to reproduce UNC path to GetParentPath()
2017-10-09 14:05:16 -07:00
Steve Lee ff59be3c61 fix detection of whether -LiteralPath was used to suppress wildcardexpansion for navigation cmdlets (#5038)
* [feature]
fix detection of whether `-LiteralPath` was used to suppress wildcardexpansion

* [feature]
skip -literalpath test with asterisk in filename as that's not valid on Windows

* [feature]
added more variations of tests
2017-10-09 09:33:22 -07:00
Travis Kinney 1d5c310897 SetServiceCommand: Add positional parameter attribute (#5017)
* SetServiceCommand: Add positional parameter attribute

Added a positional parameter attribute to the InputObject parameter,
giving Set-Service behavior similar to the other *-Service cmdlets.

* Add test for positional InputObjects [Feature]

Added a test to Set-Service validating InputObjects passed positionally.
2017-10-09 09:30:50 -07:00
Lucas Spits e1a0cafee8 User Agent now reports the OS platform (#4937)
Also include '<major>.<minor>' in UserAgent on windows platform.
2017-10-06 13:59:31 -07:00
Steve Lee 50607b9751 Enable support of folders and files with colon in name on Unix (#4959)
* [feature]
support folders and files with colon in name

* [feature]
only check separator in relation to colon if a colon is found

* [feature]
added comment to clarify algorithm

* added more tests
2017-10-06 11:27:15 -07:00
Mark Kraus 97ee17ccf4 Fix Delay Test Race Condition (#5035) 2017-10-06 11:17:52 -07:00
Dongbo Wang da5bc0d1a4 Merge beta.8 release branch to master 2017-10-05 17:37:51 -07:00
Travis Plunk 277b81141a Update ChangeLog for beta.8 release (#5006) 2017-10-05 16:43:08 -07:00
Paul Higinbotham 4bb9c5bf2c Fix for impliict remoting test (#5009)
Fix test setup that was using `New-PSSession` instead of the helper function `New-RemoteSession` that works with AppVeyor. Re-enabled the pending test since it now works. Also added a check to ensure WinRM remoting is enabled and an endpoint is available for PowerShell 6.0.
2017-10-05 16:16:21 -07:00
Steve Lee ba7dfcc0d0 Fix powershell to update the PATH environment variable only if PATH exists (#5021) 2017-10-05 14:23:52 -07:00
Steve Lee 5eee6a8f38 Increase timing on test service side to avoid a race condition in the webcmdlet timeout test (#5005)
increase timing on test service side to avoid a race condition for the test
2017-10-05 09:46:33 -07:00
Ilya 6a68262ba2 Reformat Measure-Object test (#4972)
Remove multiple tabs and formatting issues.
2017-10-03 07:39:51 +04:00
James Truher [MSFT] f69b760f2b Be sure to change psdefaultparametervalue in the global scope (#4977)
* Be sure that you change psdefaultparametervalue in the global scope

* [Feature]
2017-10-02 16:58:47 -07:00
Mark Kraus 15a6c5748b Replace httpbin.org/gzip Tests with WebListener and Re-Enable Deflate Tests (#4948)
* Add Gzip and Deflate Support to WebListener

* [Feature] Run Feature tests

* [Feature] Address PR Feedback

* [Feature] Re-Run CI

* [feature] Update WebListener Index page

* [Feature] Run Feature tests

* [Feature] Re-run CI
2017-10-02 13:46:53 -07:00
Aditya Patwardhan 1e271ea187 Add Remoting and Job tests (#4928) 2017-10-02 13:43:43 -07:00
Steve Lee d73e97464c Fix incorrect position of a parameter which resulted in the args passed as input instead of as args (#4963) 2017-10-02 12:15:42 -07:00
Chunqing Chen 69bce66cf8 add tests for get-command -ShowCommandInfo (#4906) 2017-10-02 10:54:06 -07:00
Steve Lee 2e901e53c3 fix powershell -version and help (#4958)
PowerShell -v  behavior updated to align with other tools like git, curl, and bash where args after  -v  are silently ignored.

Built-in help updated to reflect changes we've made to the console host in PSCore6 removing unsupported parameters.

* [feature]
removed test that is no longer valid due to change in -version behavior to return error

* [feature]
fixed `-v X` so that it errors out correctly with proper exit code
updated test to catch this

* [feature]
address PR feedback

* [feature]
make -v have behavior consistent with other tools like git, curl, bash where args after -v are ignored
removed duplicate but not exactly help text that wasn't being used in the resource file
removed parameters from help that are not support in PSCore6
2017-10-01 07:39:18 +04:00
Steve Lee a82f6376ab Change CRLF to LF for files that are already in repository (#4956) 2017-09-29 17:43:57 -07:00
Dongbo Wang a4b8dd0a23 Remove Microsoft.PowerShell.CoreCLR.AssemblyLoadContext.dll (#4868)
The code in `AssemblyLoadContext.dll` doesn't need to be in a separate DLL anymore.
S.M.A.dll depends on `AssemblyLoadContext.dll`, so keeping that code out of S.M.A.dll doesn't help make S.M.A smaller size or less dependent. So the code in `AssemblyLoadContext.dll` is moved to `S.M.A.dll` and then we remove `AssemblyLoadContext.dll`.

The changes are:
- Move `CorePsAssemblyLoadContext.cs` to `src\S.M.A\CoreCLR\`
- Update `CorePsAssemblyLoadContext.cs` to get the test took moved to `Utils.InternalTestHooks` and update tests
- Update `build.psm1` and `.csproj` accrodingly
- Update `pwrshcommon.cpp` to remove `AssemblyLoadContext.dll` from the TPA list.
- `S.M.A.AssemblyExtensions` is removed as `PackageManagement` has finished their move to .NET Core 2.0. (I will work with Bryan to get the latest version uploaded to powershell-core)
2017-09-29 17:26:55 -07:00
Steve Lee 2639cd89ce Autocorrected CRLF to LF (#4943)
Also, fix `Parser.Tests.ps1` after correcting CRLF.
2017-09-29 16:28:15 -07:00
Steve Lee 8fdd68fbaa [feature] (#4954)
remove unnecessary error messages from output
2017-09-29 14:35:13 -07:00
Ilya 757c6b5f39 Write an error for powershell -version 2 (#4931)
Write an error for powershell -version <any value>
2017-09-29 23:20:28 +04:00
Chunqing Chen e3a004c036 Change PS to load the assembly with 'Assembly.LoadFrom' before 'Assembly.Load' when the file path is given (#4196)
It's to solve a side-by-side problem we have with powershell core. If a .NET Core version assembly has the same name as it's .NET ancestor in GAC, then even if you specify the file path to `Import-Module`, powershell core will still load the one in GAC because it tries 'Assembly.Load' first.
Now we change it to use `Assembly.LoadFrom` first when a file path is given, so it works for modules that have side-by-side assemblies.
2017-09-29 11:58:56 -07:00
Ilya b07f24e3c9 Exclude '-Comobject' parameter of 'New-Object' on unsupported platforms (#4922) 2017-09-28 17:29:33 -07:00
Steve Lee 99e3fe586e Enable transcription of native commands on non-Windows (#4871)
Transcription was relying on reading the screen buffer to record output from native commands.
This resulted in an unhandled exception calling an unimplemented API on non-Windows.
The fix is to use redirected output/error if reading the screen buffer is not supported.
We check whether screen scraping is supported or not only when the application is running standalone.
2017-09-28 17:15:37 -07:00
Ilya 6e77537181 Get 'PSVersion' and 'GitCommitId' from the 'ProductVersion' attribute of assembly (#4863) 2017-09-28 09:27:43 -07:00
Chunqing Chen f83e238082 add get-help tests for alias (#4895) 2017-09-28 08:47:42 -07:00
James Truher [MSFT] d20d6a606a Add source files for coverage run (#4925)
A number of tests require the sources to be present in order to work correctly.
During cleanup be sure to remove any lingering powershell.exe processes because subsequent runs will not be able to update the test binaries.
2017-09-27 15:36:21 -07:00
Travis Plunk 951e7527eb Add line secret suppression (#4935) 2017-09-27 15:34:12 -07:00
Travis Plunk f02e692a5d Fix credential scan issues (#4927)
* Add file secret suppression
* Add line secret suppression
* This will be consumed in the VSTS daily build.
* Renamed tests with ConvertTo-SecureString to avoid false positives
2017-09-27 11:54:22 -07:00
Mark Kraus a8e8b1f8e4 Change UserAgent App WindowsPowerShell -> PowerShell (#4914)
* Change UserAgent App WindowsPowerShell -> PowerShell

* [Feature] Run Feature tests

* [feature] Address PR Feedback with more precise assertion

* [feature] Address PR Feedback and add PSUserAgent Test

* [feature] add tag to describe block

* [feature] Remove describe block Add pattern to User-Agent specific tests

* [feature] Address PF Feedback

Remove all assertions for User-Agent that are not specifically about the User-Agent header.

* [feature] Match -> MatchExactly
2017-09-27 07:44:20 -07:00
Ilya 7c64c0ff25 Enable network Select-String test (#4921)
* Enable network string test

* Fix typo

* Use Get-Item to add PSDrive property
2017-09-27 07:20:02 +04:00
Mark Kraus dd02aac3d7 [feature] Fix TestValue to avoid double // in Urls (#4920)
•Adds logic in  Get-WebListenerUrl  to only apply the  TestValue  part of the path if it was supplied.
2017-09-26 09:05:55 +04:00
Steve Lee efbdea5cfe Fix importing remote module using version filters and added tests (#4900)
- Add tests for remote import-module
- Fix issue with remotely importing module where it was checking the version filter incorrectly against the proxy module
   - The filters are applied when importing the module remotely
   - After proxy module is generated it always has a module version of 1.0, so the filters will always fail when importing the proxy locally
2017-09-25 21:37:56 -07:00
Steve Lee 901a61bcc1 Enable auto EOL on git repo side, fix some character encoding issues (#4912)
- add ending newline to files missing it using:
`awk -F: '$2 ~ / no line terminators/ {print $1}' ~/text-files.txt | xargs -I{} sh -c 'printf "\n" >> "$1"' - {}`
- update .gitattributes to enforce autocrlf on all text files
- added <copyright> opening element where it was missing
removed file attribute pointing to wrong filename
- fix mis-encoded character to apostrophe
- replace incorrect encoding of copyright symbol with (c)
- updated file hashes in the test
2017-09-25 15:14:39 -07:00
Mark Kraus b30da378e7 Replace httpbin.org/delay Tests with WebListener (#4905) 2017-09-25 12:50:15 -07:00
Steve Lee 65415c3b9e allow * to be used in registry path for remove-item (#4866)
* [feature]
allow * to be used in registry path for remove-item

* [feature]
address PR feedback
have remove-item return error if -literalpath doesn't resolve to path

* [feature]
fix in navigation exposed an issue with WSMan Config Provider tests
that require -Recurse to be used otherwise a confirmation prompt shows
up
2017-09-25 10:15:38 -07:00
Mark Kraus 3237d43b26 Add ResponseHeadersVariable Parameter to Invoke-RestMethod (#4888)
* Add ResponseHeadersVariable to Invoke-RestMethod

* Add Tests for -ResponseHeadersVariable

* [Feature] Run Feature Tests

* Remove test to address PR feedback

* Alais HV -> RHV per request

* [Feature] Rerun CI

* [Feature] Remove Superfluous Assertion
2017-09-25 10:11:12 -07:00
Steve Lee 25a32284dd fix tests not setting back $psdefaultparametervalues back correctly (#4892) 2017-09-23 13:48:51 -07:00
James Truher [MSFT] 40577cb61f Add the timezone offset correctly (#4867)
It must be padded to 3 digits and prepended with either '-' or '+'
An incorrectly formatted string will not be able to be converted back to a datetime
2017-09-22 11:25:48 -07:00
Mark Kraus 65cf571b54 Replace httpbin.org/encoding Tests with WebListener (#4869) 2017-09-22 10:09:49 -07:00
Dongbo Wang c9cf843302 Fix a test issue that causes tests to be skipped in Travis CI run (#4891) 2017-09-21 11:54:48 -07:00
Ilya 93dc591025 Add 'ArgumentCompletionsAttribute' to support more argument completion scenarios (#4835)
- Add 'ArgumentCompletionsAttribute' to support argument completion for parameters that cannot have a ValidateSetAttribute.
- Use 'ArgumentCompletionsAttribute' for the '-Format' parameter of 'Get-Date' to enable useful argument compeltions.
2017-09-21 10:52:21 -07:00
Jonas Andersen f281671375 [Feature]Added Remove-service to Management module (#4858)
* [Feature]Remove-Service added to Management module

* [Feature]Capitalization

* [Feature]Added test cases for Remove-Service, Removed return value

* [Feature]Documentation from copy-paste code corrected to reflect the new function

* [Feature]Erroraction to be sure that an error is thrown in testcase

* [Feature]Removed direct reference to module in Pester test

* [Feature]Removed extra line in test

* [Feature]Use FullyQualifiedErrorId in Remove-Service test without a valid servicename

* [Feature]Exposed Remove-Service

* [Feature]Consistent casing, Named Arguments & Remove incorrect exception on cleanup

* [Feature]Remove-Service test should fail if the service was not removed

* [Feature]Cleanup comments & add Remove-Service for CI

* [Feature]Remove-Service in CI set in alphabetic order

* [Feature]Use ParameterSetName instead of _ParameterSetName and rewrite test which used the function class directly

* Revert "[Feature]Use ParameterSetName instead of _ParameterSetName and rewrite test which used the function class directly"

This reverts commit da41f7deb8.

* [Feature]Remove _ParameterSetName check & added test for pipeline input in
Set-Service
2017-09-20 17:24:39 -07:00
Dongbo Wang 4c29f5768d Fix bugs with expression redirected to file (#4847)
When handling file redirection for CommandExpression, we don't call 'DoComplete' on the underlying PipelineProcessor of the FileRedirection object, and thus the EndProcessing method is not called on Out-File, which causes different behaviors between <expr> > out.txt and <expr> | Out-File out.txt.

The fix is to make sure 'DoComplete' is called after the stream output has been written to the redirection pipe.

Also fix another issue

This PR also fixes an issue that could mess up restoring the original pipes. Here is the repro:

PS> 1 *> b.txt > a.txt; 123
Cannot perform operation because object "PipelineProcessor" has already been disposed
The root cause is that we don't always restore pipes in the correct order. Please see the code changes in Compiler.cs for more details.

Fix #4812
2017-09-20 14:39:02 -07:00
Staffan Gustafsson 916ef56eeb Call to CodeMethod returning void should work (#4850)
Fixes #4826
2017-09-20 14:37:43 -07:00
Paul Higinbotham 7c8b7eff52 Port tests for constrained language mode (#4816)
* Port tests for constrained language mode
* Added 'RequireAdminOnWindows' for registry access
* Restored Wait-UntilTrue to current state
2017-09-19 14:53:29 -07:00