Commit graph

1181 commits

Author SHA1 Message Date
Mark Kraus b4e8e9d06b Replace HttpBin.org/response-headers Tests with WebListener (#5058) 2017-10-18 12:24:02 -07:00
Dongbo Wang 2ceec725f6 Fetch resource string correctly (#5114) 2017-10-18 11:36:25 -07:00
Chunqing Chen dd5fba3313 Exclude PSHostProcess cmdlets from Unix platforms (#5105)
- Exclude 'Get-PSHostProcessInfo', 'Enter-PSHostProcess' and 'Exit-PSHostProcess' from Unix platforms.
- Update tests and add additional cmdlets need to be excluded
2017-10-18 09:26:24 -07:00
Steve Lee 6177d28410 removed RunspaceConfiguration support (#4942)
For PSCore 6, we are only supporting InitialSessionState. The RunspaceConfiguration APIs were already made internal. This PR removes all the code related to RunspaceConfiguration. This also means that some public APIs have changed. Was deciding between leaving the RunspaceConfiguration parameters and throwing Unsupported, but thought it was better to have it a compile-time error. This should simplify the code base.
2017-10-18 09:12:23 -07:00
Mark Kraus 7c9bddfa3d Add Authentication Parameter to Web Cmdlets for Basic and OAuth (#5052)
Closes #4274

Adds an -Authentication parameter to Invoke-RestMethod and Invoke-WebRequest
Adds an -Token parameter to Invoke-RestMethod and Invoke-WebRequest
Adds an -AllowUnencryptedAuthentication parameter to Invoke-RestMethod and Invoke-WebRequest
Adds tests for various -Authorization uses
-Authentication Parameter has 3 options: Basic, OAuth, and Bearer
Basic requires -Credential and provides RFC-7617 Basic Authorization credentials to the remote server
OAuth and Bearer require the -Token which is a SecureString containing the bearer token to send to the remote server
If any authentication is provided for any transport scheme other than HTTPS, the request will result in an error. A user may use the -AllowUnencryptedAuthentication switch to bypass this behavior and send their secrets unencrypted at their own risk.
-Authentication does not work with -UseDefaultCredentials and will result in an error.
The existing behavior with -Credential is left untouched. When not supplying -Authentication, A user will not receive an error when using -Credential over unencrypted connections.

Code design choice is meant to accommodate more Authentication types in the future.

Documentation Needed

The 3 new parameters will need to be added to the Invoke-RestMethod and Invoke-WebRequest documentation along with examples. Syntax will need to be updated.
2017-10-17 19:08:06 -07:00
Steve Lee 2cc091115b Rename powershell.exe to pwsh.exe (#5101)
- Rename powershell.exe to pwsh.exe
- Fixe appveyor.psm1
- Update MSI to include 'pwsh' in path and app paths
- Revert change for hyper-v powershell direct
- Update names in packaging.psm1.
- Fix check for SxS
2017-10-17 17:25:11 -07:00
Mark Kraus 17731cf6e9 Add Get-WebListenerUrl Based Examples to WebListener README.md (#4981)
- Add Get-WebListenerUrl Based Examples to WebListener README.md
- Fix Cert test example
2017-10-17 16:18:54 -07:00
James Truher [MSFT] d5445ff691 Make sure that there's a statement separator after we update the path, otherwise the built script will not run (#5137) 2017-10-17 13:32:21 -07:00
Aditya Patwardhan 486fb97123 Test fixes and code coverage automation fixes. (#5046)
* Test fixes and updates to code coverage automation
* Fixed UpdatableHelpSystem tests and tab completion tests
* Fixed tab completion tests to better disambiguate root/interop namespace.
* Skip SSH test if ssh.exe is not present
2017-10-13 13:54:43 -07:00
Dongbo Wang f2eaeb8b8e Remove '-ComputerName' from 'Get/Set/Remove-Service' (#5094) 2017-10-13 22:06:46 +04:00
Chunqing Chen 07d3b1806c Get-Content -Raw should not neglects to read the last character, if it is a LF (#5076) 2017-10-13 11:05:51 +04:00
Tadas Medišauskas 844bf11dde Get-Verb: add verb descriptions and alias prefixes (#4746)
* Get-Verb: add descriptions and prefixes

* Add description and alias prefix tests

* Make the new classes internal

* Convert alias prefix to static method

* Move verb descriptions to a resource file

* Shorten function name

* Shorten alias prefix function name

* Change tests to look at counts

* Add uniqueness test

* Add missing alias prefixes

* Fix name collision

* Change alias prefix for Compare

* Rename method

* Remove unnecessary string allocation

* Make tests easier to diagnose
2017-10-12 14:40:06 -07:00
Dave Wyatt 94a71b05d4 Fix ValueFromRemainingArguments to have consistent behavior between script and C# (#2038) 2017-10-11 17:09:59 -07:00
Indhu Sivaramakrishnan 2a9cd7211f Add tests for Dsc configuration compilation on Windows (#5011) 2017-10-11 10:49:35 -07:00
Steve Lee 59311d03e1 Properly escape trailing backslash so that it doesn't end up escaping the quotes (#4965)
The native command receives the arg ".\test 1" as  .\test 1"  as the last  \"  is treated as escaping the quotes. Fix is to add an extra backslash to escape the last enclosing quote.
2017-10-11 18:01:09 +04:00
Raghav S 7dd36c9e34 Add NoNewLine switch for Out-String cmdlet (#5056) 2017-10-11 17:44:57 +04:00
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
James Truher [MSFT] fb7c7b038b Only run tests on Windows, otherwise skip them. (#4861) 2017-09-19 13:51:21 -07:00
Steve Lee 66552a430f Add CDXML CIM DateTime test (#4796) 2017-09-18 17:10:58 -07:00
Sarith Sutha af798fb644 Add tests for Get-Content (#4723)
* Add tests for Get-Content -Tail #4150

* Incorporated the review comments

* renamed couple of tests

* removed extra spaces

* Tests refactored into a Context and the checks broken down into separate tests

* Made the indents consistent with the other existing tests

* Incorporated the review comments
2017-09-18 16:58:58 -07:00
Steve Lee 23420643e3 Added WSMan Config provider tests (#4756)
* [Feature]
fixed issues in WSMan Config Provider
added tests for get-item, get-childitem, set-item, new-item remove-item, clear-item, dynamic parameters
merged CoreClr and FullClr code

* [feature]
address PR feedback

* [feature]
revert to using microsoft.powershell plugin as base for test
keeps it simple rather than relying on additional scripts or cmdlets since these tests don't require remoting

* [feature]
address Aditya's feedback

* [feature]
address some cosmetic feedback

* [feature]
based on discussion with Jim, we should skip resx checks on non-Windows
2017-09-18 15:44:09 -07:00
Dongbo Wang 192803bfcf Build powershell core using the generic RID 'linux-x64' (#4841) 2017-09-18 09:31:07 -07:00
Mark Kraus a2dd0ca4b5 Replace httpbin.org/redirect Tests with WebListener (#4852) 2017-09-18 09:26:01 -07:00
Dan Travison a3e129c586 Fix tests that incorrectly use ShouldBeErrorId (#4793) 2017-09-18 09:24:55 -07:00
James Truher [MSFT] 0229451148 Validate product resource strings against resx files (#4811) 2017-09-18 09:20:46 -07:00
Dan Travison 0770746e7d Add tests for Get-Content -Tail parameter (#4790) 2017-09-18 08:51:36 -07:00
Jonas Andersen b7ec5da216 Added functionality to set credientials on Set-Service command (#4844)
Now we can specifiy the -Credential parameter on Set-Service cmdlet to change a service's logon account.
2017-09-18 14:23:17 +04:00
Lucas Spits 03e3257b0a Updated default ModuleVersion in ModuleManifest (#4842)
* Updated default ModuleVersion in ModuleManifest to 0.0.1

* updates tests where manifests default versions where still matched agianst the old 1.0 version
2017-09-15 11:44:07 -07:00
Steve Lee b723d6b7f2 fix set-service failing test (#4802)
* Add '-ErrorAction Stop' in Set-Service.Tests.ps1 to correctly test exceptions.
* Refactor StartupType service code and add a throw for disabled startup types (System, Boot).
* Made StartupType(-1) equivalent to Win32 SERVICE_NO_CHANGE.
2017-09-15 12:24:40 +04:00
bergmeister da49841f16 Use a simple file based check for the VC++ 2015 redistributables (#4745)
* A simple and minimal fix of 4665 to check for the Visual Studio C++ 2015 redistributables. Note that this is specific to 2015 (vcruntime140.dll refers to the Visual Studio version 14.0, which maps to Visual Studio 2015).
A previous check registry check of 'SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum' failed because when the redistributables are installed via Windows update (which does not use MSI), then the registry entry did not get populated.
The 'Pending' attribute was removed from existing tests since the download links are now present again and the tests were improved using Pester TestCases.

* Fixed typo spotted in code review of PR 4745

* Remove DirectorySearch Id duplication by defining it once and referencing according to this special trick in the official WiX documentation here: http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/directorysearchref.html
Renamed property values as suggested.

* Remove replacements of HTTPS with HTTP, i.e. test against exact link. Use -UseBasicParsing switch with the hope of not having failures in the CI environment.
Added comment why there is no assertion about the StatusCode.

* Replace download links with link to pre-requisites page as suggested in PR 4745 because this page is easier to update

* Compilation error CNDL0012 fix: WiX does not allow lowercase characters for file search property Ids because due to them being used for a search property means that they must be public, hence lowercase is not allowed.
2017-09-14 18:42:36 -07:00
Ilya a4cdb806f4 Exclude directories discovered from '-Path' in Select-String (#4829)
Select-String can search in files only so we should skip directories.
2017-09-14 14:57:17 -07:00
James Truher [MSFT] a9db9ba482 Skip Certificate Authentication tests on CentOS and Mac (#4822)
These two tests have been failing on CentOS for some time. It is because the available libcurl library does not support client authentication certificates
2017-09-14 10:52:35 -07:00
Mark Kraus 303a83546b Replace httpbin.org/user-agent with WebListener (#4798)
* Replace httpbin.org/user-agent with WebListener

* [feature] -SkipCertificateCheck To avoid cert issue

* [Feature] Rebase & Rerun CI

Rerun count: II
2017-09-14 09:23:29 +04:00
Mark Kraus 869cdf9ba4 Replace httpbin.org/headers with WebListener Get (#4799)
* Replace httpbin.org/headers with WebListener Get

* [feature] -SkipCertificateCheck to avoid Cert issue

* [Feature] Rebase & Rerun CI
2017-09-14 09:22:52 +04:00
Steve Lee 5fedd9c54f added tests for start/stop/suspend/resume/restart service cmdlets (#4774) 2017-09-13 10:24:04 -07:00
Steve Lee 4ad313aafb Add tests for Get-Module over remoting (#4787)
Some additional tests that are remoting specific based on code coverage
2017-09-12 17:12:52 -07:00
Dongbo Wang c06ffc4a5c Add a generic file watcher function in HelpersCommon.psm1 (#4775)
Add a generic file watcher function in HelpersCommon.psm1 and update some tests to use the `Wait-FileToBePresent`.
2017-09-12 13:05:47 -07:00
Dan Travison 6a78e303ff Mitigate intermittent failures in access denied tests. (#4788)
This change mitigates intermittent timeout failures in the access denied tests as well as fixes unintended cross-test dependencies. If PowerShell takes longer that 10 seconds to complete a race can cause the subsequent test to pick up the output file of the previous test and fail (i.e., the expected output error file already exists from the previous test because it was created by the long running PowerShell process after the second test started.) Worse case, the failure cascades causing the race to propagate through the remaining tests in the set.

The fix is two fold:
1: Increase the timeout for waiting for the launched powershell process. (mitigation)
2: Ensure each uses a unique name for the error and done files to avoid polluting the next test.
2017-09-12 11:01:32 -07:00
Mark Kraus fd3a003765 Add Multipart Support to Web Cmdlets (#4782)
Partially implements  #2112
- Adds `System.Net.Http.MultipartFormDataContent` as a possible type for `-Body`
- Adds `/Multipart/` test to WebListener 

This allows for the user to create their own `Http.MultipartFormDataContent` object and submit it. Since `multipart/form-data` submissions are highly flexible, adding direct support for it to the CmdLets may over-complicate the command parameters and a limited implementation would not address the broad scope of use cases. This at least allows the user to submit multipart forms using the Web Cmdlets and not have to manage their own `HttpClient`. Once this is introduced, limited multipart implementations can be expanded to use the code in this PR.
2017-09-12 09:41:36 -07:00
Steve Lee 1e4cbe15ff Added tests for get-service based on code coverage analysis (#4773)
* reformated test cases

* added whitespace to format the test cases
2017-09-12 08:48:37 +04:00
Steve Lee 6b684bb7dd The PSSessionConfiguration tests were putting many repeated warning messages into the log, changed warnings to be silent (#4794) 2017-09-11 17:45:21 -07:00
Dongbo Wang ad0b4cc54b Add tests for ProxyCommand APIs to improve coverage (#4791)
Examine the code in ProxyCommand.cs to find out specific missing areas.
2017-09-11 14:06:32 -07:00
Travis Plunk a3e193a6b3 Add tests for 'New-Object -ComObject' (#4776) 2017-09-11 12:53:34 -07:00
Steve Lee 625717493b added tests for test-wsman (#4771) 2017-09-11 12:31:08 -07:00
Littlejohn bbc180a918 Added Meta, Charset, and Transitional parameters to ConvertTo-HTML (#4184) 2017-09-11 12:22:10 -07:00
Dongbo Wang 0dc575dbf6 Disable a failing test case in AppVeyor daily run (#4806) 2017-09-11 10:54:57 -07:00
Dongbo Wang b2fa0ee522 Add tests for StaticParameter to improve coverage (#4779) 2017-09-11 08:54:35 -07:00
Steve Lee 2761c3ff21 Increase Set-Service and New-Service test coverage (#4785)
* reformatted file to be consistent

* manual fix formatting
2017-09-09 20:19:16 +04:00
Ilya fc9d798b77 Enable use 'Singleline,Multiline' option in split operator (#4721)
Fix #4712
2017-09-08 09:23:38 -07:00
Sarith Sutha f4b075c856 Add -WhatIf switch to Start-Process cmdlet (#4735)
* Add -WhatIf switch to Start-Process cmdlet
* Add test for the -WhatIf switch 

* Added a test to ensure that using a whatif switch prevents the action from being performed.

* Incorporated code review comments

* merged two tests into one as suggested

* Included the error action at the end of the cmdlet

* Remove extra space before `StringUtil` and new line

* Renamed the resource string id ProcessStartInfo to StartProcessTarget
2017-09-08 09:18:13 +04:00
Mark Kraus f41461825a Replace httpbin.org/get tests With WebListener (#4738)
* Adds the /Get/ functionality to Weblistener
* Replaces the tests that rely on httpbin.org/get with WebListener


* [Feature] Move HttpBin/Get Tests to WebListener

* [Feature] update .spelling

* [Feature] Address PR Feedback

* [Feature] Add and document Home & /

* Readme Update

* [Feature] Should Match -> Should Be

Rerun CI

* [Feature] Rebase and Rerun CI
2017-09-08 07:53:04 +04:00