Commit graph

5811 commits

Author SHA1 Message Date
Mark Kraus c6cd66bca8 [feature] Make UTF-8 Default Encoding for application/json (#6109)
When a charset is not supplied for a JSON response, the default encoding should be UTF-8 per RFC 8259. This commit changes the default charset to UTF-8 for JSON responses when a charset is not defined.
2018-02-22 09:31:00 +04:00
Travis Plunk f906e9ddba
Revert PR 6043 - Adds script to patch the shortcut working directory to the user's home folder (#6203)
Revert PR 6043 - Remove failing script from MSI

reverted from commit 795c611
2018-02-21 10:29:29 -08:00
Travis Plunk ca959a735a
change the registry version detection value to semver from the default value (#6192)
change the registry version detection value to semanticversion from the default value
fixes #6171
2018-02-21 10:28:12 -08:00
Klaudia Algiz 43572b0831 Add tests for Set-Item Cmdlet for Function Provider. (#6166) 2018-02-20 15:00:49 -08:00
Travis Plunk 595a79870e
fix spelling failures in CI (#6191)
This fixes spelling failures in CI. It appears to be caused by a change in the tool used to test spelling
This change:

-Updates the dictionary for new and words which are detected differently
-updates markdown where it is more appropriate
-adds one file to the markdown tests.
2018-02-19 14:00:36 -08:00
Klaudia Algiz 17b501c9fa Support running tests in root privilege on Linux. (#6145)
Support running tests in root privilege on Linux by adding the `REQUIRESUDOONUNIX` tag.
- Delete skip tag in tests which require `sudo`.
2018-02-16 11:13:23 -08:00
Steve Lee d20c727d39 Enable $env:PAGER to work correctly if arguments are used (#6144)
Correctly parse $env:PAGER with args like 'less -w'.
2018-02-15 08:11:45 +04:00
Klaudia Algiz d6e978f82a Invoke-Item.Tests.ps1 handles finding multiple ping executables. (#6120)
Invoke-Item.Tests.ps1 handles finding multiple ping executables.

Fixes Issue #5220
2018-02-13 17:01:24 -08:00
Steve Lee c1c5344a88 Update copyright and license headers (#6134)
Based on standard practices, we need to have a copyright and license notice at the top of each source file. Removed existing copyrights and updated/added copyright notices for .h, .cpp, .cs, .ps1, and .psm1 files.

Updated module manifests for consistency to have Author = "PowerShell" and Company = "Microsoft Corporation". Removed multiple line breaks.

Separate PR coming to update contribution document for new source files: #6140

Manually reviewed each change.

Fix #6073
2018-02-13 09:23:53 -08:00
Ilya 0ad9fc9d70
[breaking-change] Fix range operator (#5732)
Breaking-change:  "0".."9" returns [char] previously in PowerShell Core (6.0.0, 6.0.1), now it returns [int]. After the change, the behavior is the same as in Windows PowerShell.
2018-02-11 14:22:45 +04:00
Andrew dc6fe2af29 Update Raspbian installation instructions to create pwsh symlink (#6122)
* Update Raspbian installation instructions to create pwsh symlink
2018-02-09 14:00:29 -08:00
Steve Lee fc627a1dba add guidance on adding copyright and license header to new source files (#6140) 2018-02-09 10:40:28 -08:00
Andrew Palmer 29d50b0e94 Update examples to 6.0.1 and removed a removed parameter in Install-PowerShellRemoting.ps1 (#6060)
The PowerShellVersion parameter no longer exists in Install-PowerShellRemoting.ps1.
Updated examples to 6.0.1 from alpha 9
2018-02-08 13:52:31 -08:00
Klaudia Algiz d6678d8417 Refactor the Get-Content tests to use -TestCases. (#6082) 2018-02-08 13:32:10 -08:00
Chunqing Chen 40eb3b3e13 Get-ChildItem <PATH>/* -file should include <Path> as search directory (#5431)
* get-childitem <PATH>/* -file should include <Path> as search directory

* [Feature] Added check for -Directory and more tests

* [Feature] Added check for the dynamic parameter type
2018-02-07 16:30:14 -08:00
Steve Lee 8b05408b1b Improve table view for Certs and Signatures by adding EnhancedKeyUsageList and StatusMessage (#6123)
* add EnhancedKeyUsageList to default table view of X509Certs
add StatusMessage to default table view of cert signatures

* set fixed width of 20 to Subject so more room for EnhancedKeyUsageList content
change EnhancedKeyUsageList to script to just show the friendly name
2018-02-07 15:29:48 -08:00
Travis Plunk 363c964ebd
add scripts to set/update the release tag in VSTS (#6107) 2018-02-07 15:24:34 -08:00
Christoph Bergmeister 88909811ff Msi installer: Add smoke test (#6105)
PR 6043 broke the installer (issue #6095). To prevent this from happening in the future, add a smoke test that installs the msi in appveyor build and make build fail if installation failed.
It uses the exit code to determine the success. The reason why it does not fail in the current state is because as I pointed out here, the failing custom action is not returning its exit code.
2018-02-07 15:00:42 -08:00
Dongbo Wang c0cb240ebd Update 'Restore-PSPester' to use 'Save-Module' (#6112)
Update Restore-PSPester to use 'Save-Module' to get the latest version of Pester.
We have moved to the latest version of Pester via PR #6064
2018-02-07 13:44:29 -08:00
Takuya Shibata 22014a923a Use 'RequireAdminOnWindows' tag in Set-Date tests (#6034)
* Use 'RequireAdminOnWindows' tag instead of 'Test-IsElevated' function.

* Fix incorrect condition of user privilege in Linux/macOS CI
2018-02-06 09:31:30 -08:00
James Truher [MSFT] 99a7d38cae Update test framework and tests to support 4x version of Pester (#6064)
* Test fixes and changes needed to support Pester 4.0.8

* Replace 'Should Contain' with new 'Should FileContentMatch' assertion

Explicitly check for string creation with write-output

* Use the current version of pester and install it in modulesDir

* Simplify logic for relative path test.

Multiple '..' is not needed for a relative path, a single one will do. Also, on multi-drive systems using split-path -noqualifier will probably do the wrong thing with regard to constructing a correct path.
Remove extraneous Should Not Throw test, if this throws, the test will fail, we don't need to explicitly assert the not throw

* In some environments it is possible that computer name is 'localhost', so that should be allowed

* [feature] Add link for migrating tests from Pester v3 to v4

Fix up capitalization and white space issues
Change one test to check FullyQualifiedErrorId rather than just `Should Throw`

* [feature] update invoke-item test to handle the case where multiple notepad processes are running

* Fix spelling issue with Pester 4x, calling it Pester 4 should be sufficient
2018-02-05 11:58:25 -08:00
Travis Plunk fa40a87bd7
Add registry value for easy detection (#6094)
Add registry value for easy detection. For example, the presence of a single key of 6.0.* x64. This is much faster than MSI detection.

Note there are currently two GUIDs, one for 6.0.* x64 and one for 6.0.* x86.

fixes #6090
2018-02-05 10:02:58 -08:00
Steve Lee 3a81c2b58f Enable setting PSSession Name when using SSHTransport and added Transport property (#5954)
When using New-PSSession -SSHTransport -Name ... the Name parameter wasn't being used when creating the remoterunspace so an automatically generated one was always created.
Fix is to explicitly pass the transport name when generating a runspace name including other transports like VMBus and Container.

Refactor runspace name generation code to produce "RunspaceN" and added a Transport property.

Tests will have to wait until we have the infrastructure for remoting tests and Enable-SSHRemoting work is complete.

Fix #5951
Fix #2426
2018-02-04 13:12:48 -08:00
Steve Lee 6ceaf92bf9 change logo to SVG (#6072)
Current README uses a PNG which doesn't scale for high dpi displays (starts to look fuzzy).
Created 64 pixel wide version of svg of the black logo and inserted into README.md.
Note that it currently doesn't render as the absolute URL points to master so that it gets
rendered correctly in other places where the README.md is used (like docker hub).
2018-02-02 18:35:59 -08:00
Mark Kraus 37780de9b7 [Feature] Remove -TimeOutSec from non timeout related tests (#6055)
The timeout mechanism should be supported by the test framework (Pester here).
2018-02-02 23:56:06 +04:00
Dan Travison 0191946fe3 Fix the filtering of analytic events on Unix platforms. (#6086)
- Remove previous `UseAlwaysAnalytic` workaround in `SysLogProvider.Log`
- Update Script Block logging to always log to the operational channel with `UseAlwaysOperational`
- Fix `PSChannel` on Linux to use a bitmask
- Handle `UseAlwaysOperational` and `UseAlwaysAnalytic` keywords but adding to `_keywordFilter` if the associated channels were selected in the configuration
2018-02-02 10:49:09 -08:00
Priyesh e172e17b9e Doc: Fix the command to build type catalog in internals.md (#6084) 2018-02-01 10:18:04 -08:00
Ilya ca4e4798fb Remove unsupported members from the enum 'Language' in Add-Type (#5829)
[breaking change]
Remove the unsupported members (various versions of CSharp and `JScript`) from the enum 'Language' in Add-Type. After this change, `Add-Type -Language` only supports `CSharp` and `VisualBasic`.
2018-02-01 09:25:20 -08:00
Mark Kraus 7d003f4f67 Change Web Cmdlet Tests to Use 127.0.0.1 not Localhost (#6069)
Change Web Cmdlets Tests to Use 127.0.0.1 instead of localhost due to dotnet/corefx#24104
This provides a decent speed boost to the WebCmdlet tests (Faster in dozens of times).
2018-02-01 08:26:05 +04:00
Ilya 05ca36463a Build: Update PowerShell to build with .NET Core SDK 2.1.4 (#6054) 2018-01-31 14:56:20 -08:00
Mark Kraus 47c4a0a74b Test: Add Verbosity and more accurate timeout implementation for Start-WebListener (#6013)
- Add verbosity to the WebListener when it fails to assist in troubleshooting
- Switch the WebListener initialization timeout to count cycles instead of using fixed dates to work around possible VM CI sleep/ issues.
2018-01-31 14:55:16 -08:00
Travis Plunk 1c5c7f5c3a
add comments about where most of the packages are from (#6016) 2018-01-31 12:16:48 -08:00
Daniel Llewellyn 7b27250479 Add Environment Variable override of telemetry (#6063)
Inspired by dotnet cli, and allows for Telemetry opt-out on packaging systems such as AppImage and Snapcraft where the filesystem is immutable.
2018-01-31 10:19:48 -08:00
Mathias R. Jessen e20f3bdac4 Fix "Pull Request Process" dead link (#6066)
Fix "Pull Request Process" anchor links in governance.md
2018-01-31 08:22:16 +04:00
Chris Duck 795c61125a Adds script to patch the shortcut working directory to the user's home folder. (#6043)
Update the shortcut created by the installer to use %HOMEDRIVE%%HOMEPATH% for the working directory.
2018-01-31 08:11:29 +04:00
Steve Lee bf691353ae new Issue-Announcement label (#6041) 2018-01-30 16:10:08 -08:00
Ilya 7f2ebd70c9
Resort parameter list in alphabetical order (#6052)
After #5920 we should reorder parameter list (#4989)
2018-01-30 07:56:00 +04:00
Travis Plunk bd865280f3
update processes to allow for coordinated vulnerability disclosure (#6042) 2018-01-27 10:28:33 -08:00
Benjamin Staneck 51dbfae0ff Rework Windows Start menu folder name (#5891)
Changes the Windows start menu folder name from ProductSemanticVersionWithName to ProductSemanticVersionWithNameAndOptionalArchitecture - now the start menu is `PowerShell` for all versions.
2018-01-26 08:14:55 +04:00
Travis Plunk 3a33be87a7 Merge branch '6.0.1' into master
# Conflicts:
#	docker/release/fedora27/Dockerfile
#	docs/installation/linux.md
#	docs/installation/macos.md
#	tools/metadata.json
2018-01-25 16:35:25 -08:00
Dongbo Wang 45bf1dc142
CI Build: Use TRAVIS_PULL_REQUEST_SHA to accurately get the commit message (#6024) 2018-01-25 13:42:49 -08:00
Dongbo Wang 875a12d3d1 Skip tests that use ExecutionPolicy cmdlets on Unix (#6021) 2018-01-25 11:18:21 -08:00
Travis Plunk 67c9ae47f8
update date on change log (#6023) 2018-01-25 10:55:17 -08:00
Mark Kraus 2f1aec1496 Fix .gitignore (#5991)
Use single '*' in file name /src/TypeCatalogGen/powershell*.inc
2018-01-25 15:23:07 +04:00
Dan Travison 43662809c7 Add '-settingsfile' to 'pwsh' to support loading a custom powershell config file. (#5920)
Support loading a custom `powershell.config.json` file via the command-line for use in testing.
This change supports replacing the default `powershell.config.json` file that's usually loaded from the `PSHome` directory with a custom version file.

The primary use-cases for this command-line option are as follows:
1. Allow the CI system to disable settings that impact test run times; such as disabling syslog usage on Linux and MacOS
2. Support testing of syslog and os_log without interfering with normal PowerShell operations during test runs via launching an instance with custom log settings.
2018-01-24 22:12:14 -08:00
Mark Kraus a36d58cf09 Add Simplified multipart/form-data Support to Web Cmdlets Through -Form Parameter (#5972)
- Adds -Form Parameter to Invoke-WebRequest and Invoke-RestMethod.
- Form Accepts any IDictionary.
- Keys are used as multipart/form-data field names (PSObject unwrapped and ConvertTo<String>(Object)).
- FileInfo values are added as StreamContent with application/octet-stream content type and the FileInfo.Name as the file name.
- Strings are treated as StringContent.
- Singe values are converted to string with ConvertTo<String>(Object) and treated as StringContent
- Top level collections are enumerated and converted as above. Nested collections are treated as a single value and converted accordingly.
- Form is mutually exclusive with -Body and -InFile.
- Per PowerShell-Committee decision, -Form makes no assumptions about the HTTP method used. It can theoretically be used with any method. User will need to manually supply -Method POST to post the form.
- ContentType and content related headers supplied to -Headers will be ignored/cleared as MultipartFormDataContent requires control of these headers.
2018-01-25 09:17:55 +04:00
Takuya Shibata f86371e347 Change Microsoft.PowerShell.Commands.SetDateCommand.SystemTime to struct. (#6006)
Change Microsoft.PowerShell.Commands.SetDateCommand.SystemTime class to struct and resolve the error in Set-Date cmdlet - SetLocalTime function is causing a parameter error (error code 0x00000057).
2018-01-25 07:54:27 +04:00
Greg Zimmerman 874f5c1a85 Return better error for 'pwsh -WindowStyle' on unsupported platforms. (#5975) 2018-01-24 14:00:57 -08:00
Paul Higinbotham 27099c3f57 Fix a NullReference exception in Enter-PSHostProcess (#5995) 2018-01-24 13:59:29 -08:00
Travis Plunk 488e395f34 Start using Travis-CI cache (#6003) 2018-01-24 13:56:42 -08:00