New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable [Environment]::OSVersion to return current OS rather than compatible version #6457

Merged
merged 5 commits into from Mar 28, 2018

Conversation

Projects
None yet
4 participants
@SteveL-MSFT
Member

SteveL-MSFT commented Mar 21, 2018

PR Summary

Without compatibility flags set in an application manifest, dotnet will report the OS as the compatible version instead of the actual OS version.
Fix is to add an application manifest that includes the section indicating compatibility.
Also added tests for existing resources we write into pwsh.exe.

Fix #6452

PR Checklist

@adityapatwardhan

This comment has been minimized.

Member

adityapatwardhan commented Mar 22, 2018

@SteveL-MSFT restarted AppVeyor build.

It "Manifest contains compatibility section" -Skip:(!$IsWindows) {
$osversion = [System.Environment]::OSVersion.Version
$osversionString = $psversiontable.os -replace "^Microsoft Windows (\d+\.\d+).*$",'$1'
"$($osversion.Major).$($osversion.Minor)" | Should -BeExactly $osversionString

This comment has been minimized.

@iSazonov

iSazonov Mar 23, 2018

Collaborator

Maybe use Should -Match

$psversiontable.os | Should -Match "$($osversion.Major).$($osversion.Minor)" 

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

This is simpler, will change

@@ -630,7 +630,8 @@ Fix steps:
Start-NativeExecution { & "~/.rcedit/rcedit-x64.exe" $pwshPath --set-icon "$PSScriptRoot\assets\Powershell_black.ico" `
--set-file-version $fileVersion --set-product-version $ReleaseVersion --set-version-string "ProductName" "PowerShell Core 6" `
--set-requested-execution-level "asInvoker" --set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." } | Write-Verbose
--set-version-string "LegalCopyright" "(C) Microsoft Corporation. All Rights Reserved." `
--application-manifest "$PSScriptRoot\assets\pwsh.manifest" } | Write-Verbose

This comment has been minimized.

@iSazonov

iSazonov Mar 23, 2018

Collaborator

I see pwsh.1.manifest in assert directory.

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

Will fix

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

surprised this wasn't caught in CI unless rcedit tries looking for pwsh.1.manifest

@adityapatwardhan

This comment has been minimized.

Member

adityapatwardhan commented Mar 27, 2018

@iSazonov are you comments blocking signoff?

@iSazonov

This comment has been minimized.

Collaborator

iSazonov commented Mar 27, 2018

I don't understand why we have pwsh.1.manifest in the assert directory and use pwsh.manifest name in the script?

@iSazonov

LGTM with one minor comment.

It "Manifest contains compatibility section" -Skip:(!$IsWindows) {
$osversion = [System.Environment]::OSVersion.Version
$psversiontable.os | Should -Match "$($osversion.Major).$($osversion.Minor)"

This comment has been minimized.

@iSazonov

iSazonov Mar 27, 2018

Collaborator

@SteveL-MSFT Please clarify - if we usually use -BeExactly for string should we use -MatchExactly for string too?

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 27, 2018

Member

Makes sense, will change

@adityapatwardhan

This comment has been minimized.

Member

adityapatwardhan commented Mar 27, 2018

@SteveL-MSFT Please have a look at CI failure:

Expected exactly 6.1.0-preview.8660, but got '6.1.0'.

@@ -667,13 +667,17 @@ Describe "Console host api tests" -Tag CI {
Describe "Pwsh exe resources tests" -Tag CI {
It "Resource strings are embedded in the executable" -Skip:(!$IsWindows) {
$pwsh = Get-Item -Path "$PSHOME\pwsh.exe"
$pwsh.VersionInfo.FileVersion | Should -BeExactly $PSVersionTable.PSVersion
$fileVersion = $PSVersionTable.PSVersion.ToString()
if ($fileVersion.Contains("-")) {

This comment has been minimized.

@iSazonov

iSazonov Mar 28, 2018

Collaborator

Seems we can remove the if.

$pwsh.VersionInfo.FileVersion | Should -BeExactly $fileVersion.Split("-")[0]

This comment has been minimized.

@SteveL-MSFT

SteveL-MSFT Mar 28, 2018

Member

You're right. Will update.

@adityapatwardhan adityapatwardhan merged commit c18b999 into PowerShell:master Mar 28, 2018

4 checks passed

WIP ready for review
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla All CLA requirements met.
Details

Lolle2000la added a commit to Lolle2000la/PowerShell that referenced this pull request Apr 24, 2018

Keep uptodate (#1)
* Revert "Pull PSReadLine from PSGallery" (#5986)

This reverts commit beffdcf.

* update 6.0.1 change log (#5937)

* Remove Fedora 25, Add Fedora 27 (#5984)

Fedora 25 was EOL on December 12, 2017

https://fedoramagazine.org/fedora-25-end-life/

Signed-off-by: Eli Uriegas eli.uriegas@docker.com

* tests: fix function to test for docker OS due to change to use linuxkit for mac (#5843)

* Also, fix syntax issues to allow to work with released Pester

* Start using Travis-CI cache (#6003)

* Fix a NullReference exception in Enter-PSHostProcess (#5995)

* Return better error for 'pwsh -WindowStyle' on unsupported platforms. (#5975)

* 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).

* 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.

* 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.

* Fix .gitignore (#5991)

Use single '*' in file name /src/TypeCatalogGen/powershell*.inc

* update date on change log (#6023)

* Skip tests that use ExecutionPolicy cmdlets on Unix (#6021)

* CI Build: Use TRAVIS_PULL_REQUEST_SHA to accurately get the commit message (#6024)

* 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.

* update processes to allow for coordinated vulnerability disclosure (#6042)

* Resort parameter list in alphabetical order (#6052)

After #5920 we should reorder parameter list (#4989)

* new `Issue-Announcement` label (#6041)

* 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.

* Fix "Pull Request Process" dead link (#6066)

Fix "Pull Request Process" anchor links in governance.md

* 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.

* add comments about where most of the packages are from (#6016)

* 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.

* Build: Update PowerShell to build with .NET Core SDK 2.1.4 (#6054)

* 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).

* 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`.

* Doc: Fix the command to build type catalog in internals.md (#6084)

* 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

* [Feature] Remove -TimeOutSec from non timeout related tests (#6055)

The timeout mechanism should be supported by the test framework (Pester here).

* 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).

* 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

* 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

* 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

* 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

* 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

* 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.

* add scripts to set/update the release tag in VSTS (#6107)

* 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

* 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

* Refactor the Get-Content tests to use -TestCases. (#6082)

* 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

* add guidance on adding copyright and license header to new source files (#6140)

* Update Raspbian installation instructions to create pwsh symlink (#6122)

* Update Raspbian installation instructions to create pwsh symlink

* [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.

* 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

* Invoke-Item.Tests.ps1 handles finding multiple ping executables. (#6120)

Invoke-Item.Tests.ps1 handles finding multiple ping executables.

Fixes Issue #5220

* Enable $env:PAGER to work correctly if arguments are used (#6144)

Correctly parse $env:PAGER with args like 'less -w'.

* 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`.

* 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.

* Add tests for Set-Item Cmdlet for Function Provider. (#6166)

* 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

* 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

* [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.

* Add options to enable PSRemoting and register Windows Event Logging Manifest to MSI installer (#5999)

* Docker package test fix and updates (#6169)

* 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

* 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

* Add tests for *-Item Cmdlets in Function Provider (#6172)

* [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.

* 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

* Refactor new-msipackage into packaging.psm1 (#6208)

Refactor new-msipackage and related function into packaging.psm1

* Docs: correct a linux installation typo (#6219)

* 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.

* fix various places that still refer to old versions of pwsh (#6179)

* Fix a typo in the help content of `pwsh` in ManagedEntranceStrings.resx

* Make it clearer how and what to mark as "not applicable" in PR template (#6209)

* use powershell windowsservercore docker image for release builds (#6226)

* Set pipeline thread stack size to 10MB (#6224)

* Uses TLS 1.2 on Windows during Start-PSBootstrap (#6235)

* Fixed TLS version error on Windows when building PowerShell

* Use TLS 1.2 in Start-PSBootStrap Without Breaking HTTPS (#6236)

* Add RequireSudoOnUnix tag for get-help <cmdletName> tests. (#6223)

* 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.

* Fix date tests failing in travis CI full builds (#6249)

* 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

* 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

* revert tests marked pending in #6230 (#6251)

* Fix the terse output on Windows for unelevated test run (#6252)

* Fix the terse output on Windows for unelevate test run

* Make the regex pattern more accurate

* use add instead of invoke web request in nanoserver docker file (#6255)

* change the artifact count for wixpdb (#6254)

* Fix `Start-PSPester` to include or exclude 'RequireSudoOnUnix' tag smartly on Unix (#6241)

If `-sudo` is specified, make sure to include 'RequireSudoOnUnix' tag on Unix if the 'Tag' is not specified.
If `-sudo` is not specified, make sure to exclude `RequireSudoOnUnix` tag on Unix if the 'ExcludeTag' is not specified.

* Add 'Path' alias to '-FilePath' parameters and others for several commands (#5817)

* Restore modules from the NuGet package cache by using dotnet restore (#6111)

* Remove AppVeyor specific cmdlet from 'Start-NativeExecution' (#6263)

Refreshed the cache by running `dotnet nuget locals all --clear` before `dotnet restore`.

* FixBuild: Revert the changes to get Pester from NuGet cache (#6282)

Attempt to fix the macOS build.
In #6263, I tried flushing the cache and it worked in the PR. However, after merging the PR, it turns out the master CI build failed again with the same Pester package restore error. So I'm reverting the change that got Pester from NuGet cache.

* Updated install md bin path (not packaged documentation) (#5914)

* Cleanup after Powershell install for CentOS/Fedora Docker Images (#6264)

* Adding "yum clean all" to CentOS 7 Dockerfile reduces docker image size by 76MB

* Adding "dnf clean all" to Fedora Dockerfile reduces docker image size by 168MB

* Refactor Web Cmdlets Tests to Pester 4 Syntax (#6257)

* Pass with Update-PesterTest
* Search and Replace Pass
* [Feature] Move to BeTrue

* Update docs with test guidelines with RequireSudoOnUnix tag. (#6274)

* Updating testing docs with RequireSudoOnUnix tag.

* Enable the pending Save-Help tests in CI (#6289)

Some CI level 'Save-Help' tests were disabled in #2806 because HelpInfo URIs for powershell modules were broken (tracked by #2807). However, they were forgotten to be enabled when the URI issue was fixed. This PR reenables those tests.

* get-childitem -LiteralPath should accept 'Include' or 'Exclude' filter (#5462)

* get-childitem -LiteralPath should accept 'Include' or 'Exclude' filter

* Test for OsLocalDateTime property of Get-ComputerInfo. (#6253)

* Test for OsLocalDateTime property in ComputerInfo.

* Add TLS1.2 workaround for code coverage script (#6299)

* Update CimDSCParser to fix Configuration compilation for DSC (#6225)

Update CimDSCParser to fix Configuration compilation for DSC

* MSI: Cause preview builds to install Side by side with release builds (#6301)

MSI: Cause preview builds to install Side by side with release builds
- change the upgrade code if there is a preview part of the version

* Make sure explorer context menu can be patched (#6302)

Make sure explorer context menu can be patched
- set keypath for explorer log context menu

* Tests for Get-Process Cmdlet for Module and FileVersion parameters (#6272)

* Tests for Get-Process cmdlet.

* Tests for Get-Process run as admin.

* Skipping some Get-Process tests on Linux

* Skip test for -FileVersionInfo parameter for Linux because of the bug that cause the command to hang.

* Add checks for ErrorId in Get-Process tests

* Change one Get-Process test status to pending for MacOs

* MSI: Make sure that file components are patchable (#6303)

MSI: Make sure that file components are patchable
- avoid changing names and guids of components between builds as this prevents patch generation
- This required submitting the file generated by heat
- add code to make sure the generated file is not out of date

* Add support for Debian in installpsh-debian.sh (#6314)

The script installpsh-debian only works for Ubuntu distributions. This PR adds support for Debian as well.

Related issue:  #5700

* Remove support for Ubuntu 17.04 in installpsh-debian.sh

* Rename some tests because they are duplicates (#6312)

Also remove a couple of language tests which were actually duplicated
Change the one loop which loops through test cases to include an iteration number to remove test name duplication

* Use new Pester syntax: -Parameter for Pester tests in Modules/CimCmdlets (#6306)

* Use new Pester syntax: -Parameter for Pester tests in Modules/CimCmdlets.

* make Linux packages use correct version scheme for preview releases (#6318)

Fixes #6315

make Linux packages use correct version scheme for preview releases
- Now uses <Major>.<Minor>.<Patch>~<PreviewName> instead of <Major>.<Minor>.<Patch>-<PreviewName> as the - was interpretted as an iteration of the release not a preview.

* markdown test: use strict in javascript (#6328)

* Clean build during daily build to ensure MSI package is generate correctly (#6334)

Clean build during the daily build to ensure MSI package is generated correctly
- Do another clean build directly before packaging to clean up files that test has added

* Build: Only restore once (#6335)

* don't restore with every publish

* Exclude lines about Pester executing test scripts from terse logs (#6336)

* Rename log and logerror to Write-Log  [$message] [-error] (#6333)

Fix #6332
This change renames log and logerror functions to a single Write-Log [$message] [-error] function to avoid conflicting with the log command on MacOS.

* Specify the runtime when running 'dotnet restore' in 'Start-PSBuild' (#6345)

* Build: Remove two unneeded lines from 'Invoke-AppveyorFinish' (#6344)

* Make relation-link handling in web cmdlets case insensitive (#6338)

* Make sure package verification failure fails the AppVeyor build (#6337)

* Make a relative redirect URI absolute when 'Authorization' header present (#6325)

* Add negative tests for Copy-Item over remote sessions (#6231)

* Add '-Restore' when build win-arm and win-arm64 (#6353)

* Added Service Point Manager call to force Tls12. (#6310)

Calls [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 during bootstrap to download PowerShell core to avoid an error.

* Use new Pester syntax: -Parameter for Pester tests in Microsoft.PowerShell.Management module. (#6294)

* Clean the intermediate artifact 'psoptions.json' from build (#6356)

* When doing daily/test build in a non-release branch use the branch name as the preview name  (#6355)

* fix errors in start-psbootstrap during release builds (#6159)

set Debian front end to non-interactive during apt-get commands, to avoid error with prompting
add libffi-dev, which is required for ruby/fpm
let fpm update to the latest

* Minor code clean-up changes (#5737)

* Add no appimage build (#6380)

* MSI: update architecture specific filenames (#6379)

* Support non-GitHub commits in the change log generation script (#6389)

* Add lambda support to -replace operator

Add support for replacement lambdas when using the -replace operator.
Requires minimal changes to existing code by using the following overload:
    Regex.Replace(string input, MatchEvaluator evaluator)
when a ScriptBlock is passed in as the replacement argument.

* Pass the 'Match' object to $_ for the substitute script block in '-replace' operation (#6029)

* Update CODEOWNERS

* Use new Pester syntax: -Parameter for Pester tests in engine. (#6298)

* Use new Pester syntax: -Parameter for Pester tests in engine.

* Build: Remov version forcing code from NuGet package generation (#6390)

* Update version numbers to 6.0.2 (#6402)

* Add script to update the version number
* Update version to 6.0.2

* Update to DotNet 2.0.6 (#6403)

Update to DotNet 2.0.6
  - this addresses [Microsoft Security Advisory CVE-2018-0875: Hash Collision can cause Denial of Service](PowerShell/Announcements#4)
  - This is a port of PowerShell@d607f20 to 6.1

* Fix 'PropertyOnlyAdapter' to allow calling base methods (#6394)

For a PropertyOnlyAdapter, the property may come from various sources, but methods, including parameterized properties, still come from DotNetAdapter. So, the binder can optimize on method calls for objects that map to a custom PropertyOnlyAdapter.

* Add configuration for https://github.com/probot/stale (#6393)

* Add yml for https://github.com/probot/stale

* Standard deviation implementation on Measure-Object (#6238)

Implement iterative standard deviation algorithm for Measure-Object

* Add 'NullReference' checks to two code paths related to 'PseudoParameterBinder' (#5738)

1. Add a null check in the tab completion code on the binding result returned from `PseudoParameterBinder`;
2. Add a null check in `CommandDiscovery.LookupCommandProcessor` on the `CommandInfo` object returned from the method `LookupCommandInfo`.

* Correct the '%c', '%l', '%k', '%s' and '%j' formats in 'Get-Date -UFormat' (#4805)

* Add `Waiting - DotNetCore` label (#6406)

Also, organize labels in alphabetical order.

* Update to Governance doc to reflect current working model (#6323)

With some changes in the PowerShell Team, need to update Governance doc to reflect current working model being used

* Make Resolve-Path -Relative return useful path when $PWD and -Path is on different drive (#5740)

* commands: make rvpa -relative do not return ./absolute_path

This happens on Windows when $pwd and -path is on different drive

* only return relative path inside current root

* fix secret and JavaScript compliance issues (#6408)

fix secret and JavaScript compliance issues
- mark secrets as a test only secrets
- make javascript use strict in a specific function

* Change 6.0.1 references to 6.0.2 for 'linux.md' (#6411)

* Stop 'ConvertTo-Json' when 'Ctrl+c' is hit (#6392)

* Update the 'ChangeLog.md' for 6.0.2 release (#6417)

* Update 'macos.md' and 'windows.md' with the version number '6.0.2' (#6416)

* remove runas.exe from tests as we have tags to control this behavior (#6432)

remove runas.exe from tests as we have tags to control this behavior
- this should reduce the likelihood of errors

* migrate the mac offical binary build to VSTS mac hosted preview (#6363)

create a PowerShellPackage...ps1 that works with these VMs (vs our custom VM)
create a script to create the \powershell folder with correct permissions
a YML VSTS build definition

* MSI: remove the version from the product name (#6415)

MSI: remove the version from the product name

During patching the original MSI information is displayed.
This makes installing a patch for an MSI with a specific version very confusing.

* Fix the NullRefException when using '-PipelineVariable' with 'DynamicParam' block (#6433)

* Add Alpine Linux support (#6367)

sys/sysctl header is not available in musl-libc based systems and system calls are available without any header inclusion. I have ported the cmake test from CoreFX repo (https://github.com/dotnet/corefx/blob/431475b8/src/Native/Unix/configure.cmake#L560).

Progress towards: #4605

* Change `Get-FileHash` tests to use raw bytes (#6430)

* Change filehash tests to use raw bytes

* Remove testablescript.ps1 from Get-FileHash tests

* Use BOM-less UTF8 input for Get-FileHash

* Use new Pester syntax: -Parameter for Pester tests in Language. (#6304)

* MSI: update path with proper value (#6441)

MSI: update path with proper value
- Add verification that path is updated

* Fix error in windows provider when the environment as an existing set of variables name that only differs by case (#6320)

- make the provider storage for the environment on windows ignore duplicates
- add tests to verify existing environment get-item behavior

* Throw better parsing error when statements should be put in named block (#6434)

* Make '-CI' not depend on '-PSModuleRestore' in 'Start-PSBuild' (#6450)

* Restore for official Linux arm builds (#6455)

* Restore for official Linux arm builds (#6455)

* Use 'Unregister-Event' to remove an event subscriber when removing 'PSEdit' function (#6449)

* Fix release packaging build (#6459)

The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules

* Fix release packaging build (#6459)

The release packaging build needs to have 'dotnet' in path, fixed that by adding Find-DotNet
Refactored restore logic so it can be used from both Start-PSBuild and Copy-PSGalleryModules

* Use new Pester syntax: -Parameter for Pester tests in modules: Microsoft.PowerShell.Utility and Microsoft.WSMan.Management. (#6366)

* Add '-AsArray' parameter to 'ConvertoTo-Json' command (#6438)

Add `-AsArray` parameter to `ConvertoTo-Json` command to always pack the output string in array brackets, even if the input is a single object.

* Update tests in Modules/Microsoft.PowerShell.Diagnostics to use new Pester syntax. (#6351)

* Update tests in Modules/Microsoft.PowerShell.Core to use new Pester syntax. (#6349)

* Update tests in Microsoft.PowerShell.Security folder to use Pesterv4 syntax (#6256)

* Upgrade tests in test\powershell\Host folder to PesterV4 syntax (#6250)

* Update change log for 6.1.0-preview.1 (#6480)

* Update docs for v6.1.0-preview.1 release (#6481)

* Update docs

* Added the missing 'stable' label

* Update stale bot message (#6462)

Fix #6446

Add "Community members are welcome to grab these works."

* Add Test-Json cmdlet (NJsonSchema) (#5229)

Resolve #4220.

The cmdlet is based on NJsonSchema.
It allows to check:

JSON by only parsing
JSON against Schema
implicitly check Schema by parsing (based on previous line check)
NJsonSchema is under MIT (approved see PowerShell#5229 (comment))

* Add -Resume Feature to Web Cmdlets (#6447)

Fixes #5964

Adds -Resume switch to Invoke-WebRequest and Invoke-RestMethod

-Resume requires -OutFile

Enables the ability to resume downloading a partially or incompletely downloaded file.

File Size is the only indicator of local and remote file parity.

If the local file is smaller than the remote file and the remote endpoint supports resume, the local file will be appended with the remaining bytes.

If the local file is larger than the remote file, the local file will be overwritten

If the remote server does not support resume, the local file will be overwritten

If the local file is the same size as the remote file, the remote endpoint will return a 416 status code. This response is special-cased as a success in this instance. The local file remains untouched and it is assumed the file was already successfully downloaded previously.

If the local file does not exist it will be created and the entire remote file will be requested.

Added tests for all code new code paths (I'm pretty sure anyway)

Added /Resume Controller to WebListener

Documented /Resume Controller

Updated .spelling to reflect terms in WebListener docs

Note: I had to change the way GetResponse() tracks the current URI as we now have 3 places where the call is taking place. I don't foresee this causing any regressions. This area needs some refactoring. especially if we want to implement a retry mechanism

* MSI: add function to generate a MSP (#6445)

add a function to generate an MSP

* Add the parameter '-Not' to 'Where-Object' (#6464)

* Doc: Update Ubuntu source creation commands to use 'curl -o' (#6510)

Updated the Ubuntu source creation commands to remove the need for piping

* Fix error in windows provider when the environment has accidental duplicates that differ only by case (#6489)

Fix error in windows provider when the environment has accidental duplicates that differ only by case.

Make the provider storage for the environment on windows ignore duplicates
 and only report the effective value.
Add tests to verify existing environment get-item behavior and to ensure that Get-Item env:<var> reports the same as $env:<var>, namely the effective value.
Fixes #6305 and supersedes #6320 based on discussion in #6460.

* Update Dockerfile test to use ubuntu 17.10 as the base image (#6503)

* Make sure that the width of the header is at least the size of the label (or propertyname) (#6487)

* Enable [Environment]::OSVersion to return current OS rather than compatible version (#6457)

* add application manifest dictating compatibility so that osversion shows appropriate os version on Windows

* Change the 'SaveError' method in Parser to use `nameof` for error ids (#6498)

Many error messages in PowerShell currently use a LINQ expression to pass both the name of the error and the message through in the error processing. This PR uses the `nameof` feature to carry the error name/ID and gets rid of LINQ expression reflection, hopefully improving performance, especially in editor scenarios.

* Use new Pester syntax: -Parameter for Pester in SDK and Provider tests (#6490)

* Add PowerShell logging tests for macOS and Linux (#6025)

This PR fixes the logging issue on Linux where logging is initialized before `-settingsFile` is parsed causing custom log settings to be ignored. (see ConsoleHost.cs and ManagedEntrance.cs)

The PR also includes basic logging tests for Linux and MacOS. PSSyslog.psm1 contains the functions to retrieve selected logged items (based on PowerShell's log id and a timestamp) and Logging.Tests.ps1 contains tests for Linux and MacOS.

* Make LanguagePrimitive.GetEnumerable treat 'DataTable' as Enumerable (#6511)

* Make LanguagePrimitive.GetEnumerable treat 'DataTable' as Enumerable

* Use new Pester syntax: -Parameter for Pester tests in modules: PowerShellGet, PackageManagement, PSReadLine (#6488)

* Fixed scenarios where `NullOrEmpty` string was used instead of `-BeNullOrEmpty` (#6535)

* Remove empty `Should -Be` statements (#6536)

* Simplify the paths the MSI uses (#6442)

- Implementation of PowerShell/PowerShell-RFC#115 (If anything changes in the RFC, we will treat it as a bug, and fix it later)
- Update registry and directory paths to use 6 for the version for stable and 6-preview for a preview release
- Add checkbox to set path
- default checkbox to off for preview builds and on for stable builds

* Remove duplicate 'Restore-PSPackage' (#6544)

* Mark Save-Help PackageManagement tests as pending (#6545)

* Update 'Update-Help' to save help content in user scope by default (#6352)

Add the parameter `-Scope` to `Update-Help`, which takes `AllUsers` or `CurrentUser`. The default value is `CurrentUser`.

* Clean up workflow logic in the module loading component (#6523)

Clean up workflow logic in the module loading component.
Workflow module is not supported in PSCore.
Currently, Import-Module throws a terminating error when seeing .xaml modules. After the change, Import-Module throws a non-terminating error when seeing .xaml modules.

* Updating solution file with new project type guids

* Removing invalid resources to make Visual Studio builds compile.

* Add Unix project to sln

* Map configurations to correct configurations

This reverts commit 9cbf601.

* Fix formatting of tables where headers span multiple rows (#6504)

* In cases where the header spans multiple rows, need to correctly calculate whitespace and trim appropriately

* Use System.Span<int> and C# 7.2 language in SMA

* Added new ref assemblies to Files.wxs
refactor tests to remove similar xml content
added single column test case

* add comment about project guids

* change project type for unix project

* add mappings for unix project

* Add comments about configuration mappings

* rename solution to powershell

* Terminate the loop in PsUtils.GetMainModule() which was infinite in case there was no main module. (#6358)

* Terminate the loop in GetMainModule if main module is null.

* Run tests with FileVersionInfo also on non-windows platforms. Add test for process which main module can be null.

* Fix error when 'Format-Wide -AutoSize | Out-String' is called. (#6491)

* Add checking if an output width is specified.

* change _failedToReadConsoleWidth variable to _noConsole bool value. 
This variable is to cache the default console width when failed to get 'Console.WindowWidth' value.

* Add ported Test-Connection cmdlet (#5328)

The Test-Connection cmdlet works on Windows and Unix.

Implemented:
Ping
Continues Ping
Traceroute
Detect MTU size (seems don't work on Unix because of .Net Core issue)
Connect to TCP port
Not jet implemented:
I'm putting this off for the future.

Detect blackhole routers
PingPath
Additional considerations
As you can see in the tests .Net Core has issues in API implementation. As a result, some tests are skipped on Unix. There is also one issue on Windows. Related comments added to tests.
I'm going to open an issue(s) in CoreFX repo.

I think we should break the feedback into two parts:

scripting functionality
interactive functionality (display output)
Now I have implemented the output to the screen as the progress bar and as text (without ETS) - we have to decide what is best to use.

* Fix running 'pwsh' produced from 'dotnet build' (#6549)

* Fix line ending in 'DefaultCommands.Tests.ps1' from CRLF to LF (#6553)

* Engine: Fix several code cleanup issues (#6552)

* Remove the FullCLR-only symbol-info related code from 'EventManager.cs' (#6563)

This is because the `AssemblyBuilder` family types do not support emitting symbol information in .NET Core.

* Use C# latest language in proj files (#6559)

Address #6547

We begin using C# 7.2 features (Span) but .Net Core doesn't seem use "Latest" as default for a language.
So we explicitly set the value.

* Use -Throw and -ErrorId native Pester parameters. (#6574)

* Support 'user@host:port' syntax for SSH Transport (#6558)

* Update installpsh-<distrofamily>.sh Installers to Handle "preview" in version number (#6573)

* Improve PSMethod-to-Delegate conversion (#6570)

Two small improvements:
1. Avoid unnecessary reflection in `ConvertPSMethodInfoToDelegate`. `PSMethod` already has the `MethodInfo` information with its `adapterData` field.
2. Avoid creating the generic `PSMethod<>` type for `PSMethod` that represents constructors, because constructors cannot be converted to a delegate anyways. In case that the `PSMethod` represents constructors, we use a simple `PSMethod` instance instead.

Also, rename the type `Unit` to `VOID` to make it more readable, since that type represents `typeof(void)`.

* Added check for existence of Location HTTP header before using it (#6560)

The HTTP RFC (https://tools.ietf.org/html/rfc7231#section-6.4) does not require a Location header to be present for redirects, thus it is required to check if the Location header is returned before using it.

* Fix Copy.Item.Tests.ps1 (#6596)

Fix formatting, absent parameter names and use -Throw and -ErrorID parameters with Should function.

* Fix formatting in Convert-Path.Tests.ps1. (#6595)

* Fix formatting in Clear-Item.Tests.ps1. (#6593)

* Fix formatting Clear-EventLog.Tests.ps1 (#6594)

* Fix typos and formatting in Clear-Content.Tests.ps1 (#6592)

* Fix typos and formatting.
* Capitalize function parameters.

* Added line break to Acess Denied error message. (#6607)

* Some fixes  in Get-Date -UFormat (#6542)

* Use UTC datetime in Get-Date -UFormat %s
Fix %l output from 0..11 to 1..12
Fix %V using Gregorian calendar

* Use a workaround for ISO 8601 week of year (uformat %V)

* Add Missing Start-WebListener to Web Cmdlet Tests (#6604)

* make gem use sudo for macOS (#6610)

gem install requires sudo on official macOS build VMs.
- make bootstrap use sudo for macOS

* Create the default PSSession configuration, not tied to a specific PowerShell version. (#6519)

Create the default PSSession configuration, not tied to a specific PowerShell version.

When Enable-PSRemoting command is run, it creates 2 sessions configurations:

first, the same as it was before with the name containing the current version expressed as: 'PowerShell.$PSVersionTable.GitCommitId'
second with the default name 'PowerShell.6' so that administrators wouldn't have to guess which specific version is installed on the target.
PR addresses the issue: #6470

* Improve performance of parsing RegexOption for '-split' by using if branches (#6605)

* Engine: Make some minor cleanup changes (#6609)

- Remove the calls to `GetTypeInfo()` in the generated `.resx` binding C# binding code (change in the tool `ResGen`).
- Remove the unused methods in `SessionState.cs`.
- Remove the calls to `GetTypeInfo()` from `Compiler.cs` and other files in `engine\runtime`.
- Fix typos in `VariableAnalysis.cs` and `ClassOps.cs`.
- Minor perf improvement in `MutableTuple.cs` by using indexing instead of linq extension method `last()`.

* Engine: Clean up unneeded 'GetTypeInfo()' calls in interpreter code (#6613)

Clean up unneeded `GetTypeInfo()` calls in interpreter code.
The `GetTypeInfo()` calls were added back in the early days of .NET Core, when most of the properties and methods of `System.Type` were removed. Now those properties and methods are back in `System.Type`, so there is no need to keep those calls.

* Make the 'PSISERemoteSessionOpenFile' a support event (#6582)

Make the `PSISERemoteSessionOpenFile` a support event, so that `Get-EventSubscriber` won't show that subscriber. `Get-EventSubscriber -Force` can still show the support event subscribers. `Unregister-Event -Force` needs to be used to remove a support event subscriber.

The event subscriber for `PSInternalRemoteDebuggerStopEvent` and `PSInternalRemoteDebuggerBreakpointUpdatedEvent` are already made support events. And this PR makes it the same for `PSISERemoteSessionOpenFile`.

* Fix formatting in Add-Content.Tests.ps1 file. (#6591)

* Fix formatting.
* Capitalize TestDrive and add empty strings.

* fix error about setting readonly variable (#6617)

* Re-order UFormat options in Get-Date (#6627)

Place in alphabetical order the options

* Support importing module paths that end in trailing directory separator (#6602)

* Remove support for file to opt-out of telemetry, only support env var (#6601)

Since a PR added support to opt out of telemetry via an environment variable, we can remove the,
always intended to be a temporary, solution of deleting a file to opt out of telemetry since the
environment variable can be defined at the system level and exist before even installing PowerShell Core.

Because the variable is defined as opt out, a value of true, yes, or 1 means no telemetry is sent.

* Fix for the Register-PSSessionConfiguration command (#6630)

Fix for the Register-PSSessionConfiguration command, as some tests were failing in: https://ci.appveyor.com/project/PowerShell/powershell-f975h
Probably because of changes in #6519

* Clean up 'GetTypeInfo()' calls under engine/parser (#6636)

`GetTypeInfo()` were added when porting PowerShell to early version of .NET Core (prior .NET Core 1.0).
Most properties and methods in `System.Type` were missing at that time. Now the call is not needed anymore and should be removed.

* Add meta properties to mac VSTS yml (#6619)

Add meta properties to mac VSTS YAML
- Add a property to clean the build machine
- Add a property to set the format of the build name
- add a property to set which queue to run the build in

* Clean up 'GetTypeInfo()' calls in 'help', 'cimSupport' and 'DscSupport' folders (#6633)

'GetTypeInfo()' were added when porting PowerShell to early version of .NET Core (prior .NET Core 1.0).
Most properties and methods in 'System.Type' were missing at that time. Now the call is not needed anymore and should be removed.

* Clean up 'GetTypeInfo()' calls in other engine sub-folders (#6635)

'GetTypeInfo()' were added when porting PowerShell to early version of .NET Core (prior .NET Core 1.0).
Most properties and methods in 'System.Type' were missing at that time. Now the call is not needed anymore and should be removed.

* Clean up 'GetTypeInfo()' calls in engine folder (#6634)

'GetTypeInfo()' were added when porting PowerShell to early version of .NET Core (prior .NET Core 1.0).
Most properties and methods in 'System.Type' were missing at that time. Now the call is not needed anymore and should be removed.

* Remove extraneous SSH and install docs from the 'demos' folder (#6628)

* Formatting: Use cache for dash padding strings (#6625)

* Reformat Format-Table tests (#6657)

* Convert identations to spaces
* Remove alias tests and extra lines
* Remane extra Describe
* Remove extra parentheses and add spaces

* Port Windows PowerShell AppLocker and DeviceGuard UMCI application white listing support (#6133)

These changes port Windows PowerShell support for Applocker and DeviceGuard User Mode Code Integrity (UMCI) to PSCore6. Windows PowerShell uses public APIs to determine if a system is in locked down mode via AppLocker or DeviceGuard, and automatically runs in constrained language mode. For more information about PowerShell constrained language, see: https://blogs.msdn.microsoft.com/powershell/2017/11/02/powershell-constrained-language-mode/

This support for application whitelisting has mostly existed in PSCore6, but the primary APIs were stubbed out in CorePSStub.cs because they relied on Windows only DeviceGuard (wldp.dll) and AppLocker (Safer APIs) public APIs. These changes re-implement PowerShell lock down APIs on PSCore6 for Windows platforms only. The AppLocker and DeviceGuard public APIs are currently only implemented in Windows OSes and are not supported on Linux or MacOS platforms.

Tests have also been ported to PSCore6 and run only for Windows platforms.

* Reduce allocations in TableWriter (#6648)

* [Feature] Reduce allocations in TableWriter
* Revert iterator
ReadOnlySpan is not supported in iterators
* Use columnsThresHold with stackalloc

* Add new reliable tests for Get-Date -UFormat (#6614)

* Add tests for Format-Table -Wrap (#6670)

* Correct a typo in comment for 'Invoke-WebRequest' (#6700)

* Add '-WorkingDirectory' parameter to pwsh (#6612)

Add `-WorkingDirectory` parameter to `pwsh` to allow starting in right working directory.

* Pretty print Export-FormatData XML output (#6691)

Pretty print Export-FormatData XML output by default.
Refactor Export-FormatData tests, remove test duplications.

@SteveL-MSFT SteveL-MSFT deleted the SteveL-MSFT:pwsh-manifest-compatibility branch Oct 26, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment