Commit graph

5834 commits

Author SHA1 Message Date
Travis Plunk a49cc9d6e3
revert tests marked pending in #6230 (#6251) 2018-02-26 16:23:59 -08:00
Travis Plunk 49ec403899
fix MSI creation errors, and capture wixpdb for later patch creation (#6221)
- add `wixpdb` output when creating `MSI` package
- capture `wixpdb` in official build
- clean up anything left behind from previous MSI builds before starting MSI build to prevent using dirty files.
- make sure MSI creation fails if there is an error
- ignore `.wixpdb` files in git
- Add functionality to `Start-NativeExecution` to 
    - only display output if there is an error 
    - log caller information
- WXS validation error fixes
    - Remove unused `ExitDialog` to fix ICE82
    - Add KeyPath to `SetPath` to fix ICE18
    - Use `HKMU` which translates to `HKLM` to runtime to fix various validation errors about creating the shortcut
- Suppress Validation errors
    - suppress ICE61, which is about same version upgrades being allowed
    - suppress ICE57, caused by the shortcut not being installed per user
2018-02-26 15:45:15 -08:00
Aditya Patwardhan a53547ce78 Add scripts to generate unified Nuget package (#6167)
Remove the functions which generated Nuget packages for Windows.
Add function New-UnifiedNugetPackage to generate nuget packages for each assembly with unix and windows runtimes.
Add function New-NuSpec and New-ReferenceAssembly for creating the required items forNew-UnifiedNugetPackage.
Add a sample for cross platform project with conditional compilation for Linux.
Add function Publish-NugetToMyGet to publish nuget packages to powershell.myget.or
2018-02-26 15:35:09 -08:00
Travis Plunk ff89b8ade7 Fix date tests failing in travis CI full builds (#6249) 2018-02-26 15:11:18 -08:00
Steve Lee 3b70f7689b Fix table alignment and padding. (#6230)
- The original change to remove extra padding didn't take into account alignment.
  Fix logic to accommodate left, center, and right alignment in the table format and also add tests.
- Fix ImplicitRemoting test that validates formatting to use same instance due to formatting changes in this PR
- Only use loopback to same powershell instance for formatting test as the other tests implicitly expect Windows PowerShell.
2018-02-26 12:43:31 -08:00
Klaudia Algiz e76354758d Add RequireSudoOnUnix tag for get-help <cmdletName> tests. (#6223) 2018-02-26 12:35:05 -08:00
Mark Kraus 16d7a62195 Use TLS 1.2 in Start-PSBootStrap Without Breaking HTTPS (#6236) 2018-02-24 12:05:49 -08:00
Joel Joseprabu a7271804f9 Uses TLS 1.2 on Windows during Start-PSBootstrap (#6235)
* Fixed TLS version error on Windows when building PowerShell
2018-02-24 11:01:37 -08:00
Ilya b8a8e8e247 Set pipeline thread stack size to 10MB (#6224) 2018-02-23 18:00:41 -08:00
Travis Plunk 7b2dff8a3c
use powershell windowsservercore docker image for release builds (#6226) 2018-02-23 15:26:57 -08:00
Travis Plunk 7cb0b2390d Make it clearer how and what to mark as "not applicable" in PR template (#6209) 2018-02-23 15:25:44 -08:00
develroo 55c3e6a0c3 Fix a typo in the help content of pwsh in ManagedEntranceStrings.resx 2018-02-23 14:52:23 -08:00
Christoph Bergmeister 96bd86e5e3 fix various places that still refer to old versions of pwsh (#6179) 2018-02-23 09:54:58 -08:00
Roman Beltyukov 3ebe0a9cb0 Add Password parameter to Get-PfxCertificate cmdlet (#6113)
Add Password parameter to Get-PfxCertificate cmdlet to allow automatization instead of prompting for password every time.
2018-02-23 07:29:02 +04:00
Michael Ababio 26b7be7b25 Docs: correct a linux installation typo (#6219) 2018-02-22 18:13:19 -08:00
Travis Plunk 9a46b3f3c0
Refactor new-msipackage into packaging.psm1 (#6208)
Refactor new-msipackage and related function into packaging.psm1
2018-02-22 13:31:00 -08:00
Steve Lee bdd6008846 Don't add trailing spaces to last column when using Format-Table (#5568)
* don't add trailing space to last column in table

* fix out-file tests to new behavior of no padding trailing spaces
2018-02-22 11:47:24 -08:00
Christoph Bergmeister 03ac50ade1 [breaking change] Throw terminating error in New-TemporaryFile and make it not rely on the presence of the 'TEMP' environment variable (#6182)
- Fixes issue #4634 by throwing a terminating error as agreed.
- Makes the command not rely on the presence of the TEMP environment variable to get path to temp directory and use the .Net method Path.GetTempPath() instead.
- Catch exception more specific as given by the documentation
- Improve existing test.
2018-02-22 23:32:01 +04:00
Klaudia Algiz 0ac01b722d Add tests for *-Item Cmdlets in Function Provider (#6172) 2018-02-22 23:26:26 +04:00
Mark Kraus 11d2e2dfd4 Add -SkipHeaderValidation Support to ContentType on Web Cmdlets (#6018)
* Add SkipHeaderValidation Support to ContentType on Web Cmdlets

* Move -SkipHeaderValidation Tests to Contexts

* Add ContentType -SkipHeaderValidation Tests

* Improve ContentType Exception

* Improve error message on invalid -ContentType
2018-02-22 11:15:05 -08:00
Kevin Marquette 93a5fed375 Add common aliases for all write-* commands default message parameter (#5816)
* add common write aliases

* add Message alias to the MessageData parameter for Write-Information
add  Msg and Message alias to the Object perameter for Write-Host

* Add tests for new aliases
2018-02-22 11:07:51 -08:00
Andrew acf0dcdc6d Docker package test fix and updates (#6169) 2018-02-22 11:05:07 -08:00
Christoph Bergmeister fddfb54669 Add options to enable PSRemoting and register Windows Event Logging Manifest to MSI installer (#5999) 2018-02-22 18:07:10 +04:00
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