mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Merge pull request #5493 from PowerShell/release
Merge v6.0.0-rc release
This commit is contained in:
@@ -271,8 +271,10 @@ GetParentProcess
|
||||
GitCommitId
|
||||
globbing
|
||||
HelpersCommon.psm1
|
||||
Himura2la
|
||||
honors
|
||||
hostname
|
||||
IISResetMe
|
||||
IncludeUserName
|
||||
InformationRecord
|
||||
IoT
|
||||
@@ -305,10 +307,12 @@ non-22
|
||||
non-CIM
|
||||
non-R2
|
||||
OAuth
|
||||
offthewoll
|
||||
oising
|
||||
oneget.org
|
||||
PetSerAl
|
||||
powercode
|
||||
PowershellNinja
|
||||
PowerShellProperties
|
||||
preview1-24530-04
|
||||
ProductVersion
|
||||
@@ -322,6 +326,7 @@ PVS-Studio
|
||||
Pwrshplughin.dll
|
||||
raghav710
|
||||
Raspbian
|
||||
rc
|
||||
rc2-24027
|
||||
rc3-24011
|
||||
README.md
|
||||
|
||||
+109
@@ -1,5 +1,114 @@
|
||||
# Changelog
|
||||
|
||||
## v6.0.0-rc - 2017-11-16
|
||||
|
||||
### Breaking changes
|
||||
|
||||
- Fix `-Verbose` to not override `$ErrorActionPreference`. (#5113)
|
||||
- Fix `Get-Item -LiteralPath a*b` to return error if `a*b` doesn't actually exist. (#5197)
|
||||
- Remove `AllScope` from most default aliases to reduce overhead on creating new scopes. (#5268)
|
||||
- Change `$OutputEncoding` default to be `UTF8` without `BOM` rather than `ASCII`. (#5369)
|
||||
- Add error on legacy credential over non-HTTPS for Web Cmdlets. (#5402) (Thanks @markekraus!)
|
||||
- Fix single value JSON `null` in `Invoke-RestMethod`. (#5338) (Thanks @markekraus!)
|
||||
- Add `PSTypeName` Support for `Import-Csv` and `ConvertFrom-Csv`. (#5389) (Thanks @markekraus!)
|
||||
|
||||
### Engine updates and fixes
|
||||
|
||||
- Add char range overload to the `..` operator, so `'a'..'z'` returns characters from 'a' to 'z'. (#5026) (Thanks @IISResetMe!)
|
||||
- Remove `CommandFactory` because it serves no real purpose. (#5266)
|
||||
- Change to not insert line breaks at console window width to output (except for tables). (#5193)
|
||||
- Use `Ast` for context in parameter binding and fix to glob the native command argument only when it's not quoted. (#5188)
|
||||
- Fix dynamic class assembly name. (#5292)
|
||||
- Update powershell to use `2.0.4-servicing` dotnet core runtime. (#5295)
|
||||
- Fix `ExecutionContext.LoadAssembly` to load with name when file cannot be found. (#5161)
|
||||
- Speed up the check for suspicious content in script texts. (#5302)
|
||||
- Use native `os_log` APIs on macOS for PowerShell Core logging. (#5310)
|
||||
- Redirect `ETW` logging to `Syslog` on Linux. (#5144)
|
||||
- Improve how we pass the array literal to native commands. (#5301)
|
||||
- Make `SemanticVersion` compatible with `SemVer 2.0`. (#5037) (Thanks @iSazonov!)
|
||||
- Revert refactoring changes that broke remoting to Windows PowerShell 5.1. (#5321)
|
||||
- Port some fixes in `Job` for an issue that causes PowerShell to not respond. (#5258)
|
||||
- Multiple improvements by `CodeRush` static analysis. (#5132) (Thanks @Himura2la!)
|
||||
- Fix the Runspace cleanup issue that causes PowerShell to not respond on exit. (#5356)
|
||||
- Update PowerShell to depend on new version of `psrp` and `libmi` nuget packages on Unix platforms. (#5469)
|
||||
|
||||
### General cmdlet updates and fixes
|
||||
|
||||
- Add `-AsHashtable` to `ConvertFrom-Json` to return a `Hashtable` instead. (#5043) (Thanks @bergmeister!)
|
||||
- Fix `Import-module` to not report a loaded module was not found. (#5238)
|
||||
- Fix performance issues in `Add-Type`. (#5243) (Thanks @iSazonov!)
|
||||
- Fix `PSUserAgent` generation for Web Cmdlets on Windows 7. (#5256) (Thanks @markekraus!)
|
||||
- Remove `DCOM` support from `*-Computer` cmdlets. (#5277)
|
||||
- Add multiple link header support to Web Cmdlets. (#5265) (Thanks @markekraus!)
|
||||
- Use wider columns for process id and user. (#5303)
|
||||
- Add `Remove-Alias` Command. (#5143) (Thanks @PowershellNinja!)
|
||||
- Update `installpsh-suse.sh` to work with the `tar.gz` package. (#5309)
|
||||
- Add `Jobject` serialization support to `ConvertTo-Json`. (#5141)
|
||||
- Display full help with 'help' function. (#5195) (Thanks @rkeithhill!)
|
||||
- Fix `help` function to not pipe to `more` if objects are returned instead of help text. (#5395)
|
||||
- Fix `Unblock-File` to not write an error if the file is already unblocked. (#5362) (Thanks @iSazonov!)
|
||||
- Clean up FullCLR code from Web Cmdlets. (#5376) (Thanks @markekraus!)
|
||||
- Exclude cmdlets that are not supported on Unix platforms. (#5083)
|
||||
- Make `Import-Csv` support `CR`, `LF` and `CRLF` as line delimiters. (#5363) (Thanks @iSazonov!)
|
||||
- Fix spelling in Web Cmdlet errors. (#5427) (Thanks @markekraus!)
|
||||
- Add `SslProtocol` support to Web Cmdlets. (#5329) (Thanks @markekraus!)
|
||||
|
||||
### Build and Packaging Improvements
|
||||
|
||||
- Use `RCEdit` to embed icon and version information into `pwsh.exe`. (#5178)
|
||||
- Update Docker file for Nano Server 1709 release. (#5252)
|
||||
- Change VSCode build task to use `pwsh`. (#5255)
|
||||
- Refactor building and packaging scripts for signing in release build workflow. (#5300)
|
||||
- Always build with `-CrossGen` in CI to verify a fix in `CrossGen` tool. (#5315)
|
||||
- Separate `Install-PowerShellRemoting.ps1` from `psrp.windows` nuget package. (#5330)
|
||||
- Include symbols folder an embedded zip when packaging symbols. (#5333)
|
||||
- Add Uniform Type Identifier conforming with Apple standards using a reverse DNS style prefix. (#5323)
|
||||
- Update `Wix` toolset download link to newer version 3.11 (#5339) (Thanks @bergmeister!)
|
||||
- Re-enable macOS launcher after fixing an issue that blocked macOS package generation. (#5291) (Thanks @thezim!)
|
||||
- Set expected binaries and variable name for folder for symbols build. (#5357)
|
||||
- Rename and update PowerShell `ETW` manifest to remove the Windows PowerShell dependency. (#5360)
|
||||
- Add ability to produce `tar.gz` package for Raspbian. (#5387)
|
||||
- Update `Find-Dotnet` to find dotnet with the compatible SDK. (#5341) (Thanks @rkeithhill!)
|
||||
- Add signing manifest and script to update it with production values. (#5397)
|
||||
- Add `install-powershell.ps1` to install PowerShell Core on windows. (#5383)
|
||||
- Make `-Name` a dynamic parameter in `Start-PSPackage`. (#5415)
|
||||
- Support `[package]` tag in PR CI and fix nightly build on macOS. (#5410)
|
||||
- Enhance `install-powershell.ps1` to work on Linux and macOS. (#5411)
|
||||
- Move the `RCEdit` step to the build phase rather than the packaging phase. (#5404)
|
||||
- Allow packaging from a zip package to allow for signing. (#5418)
|
||||
- Add automation to validate PowerShell Core packages using Docker containers. (#5401)
|
||||
- Fix the `brew update` issue in bootstrap script. (#5400)
|
||||
- Enable `install-powershell.ps1` to update the current running PowerShell Core. (#5429)
|
||||
- Add standard set of VSCode workspace setting files. (#5457) (Thanks @rkeithhill!)
|
||||
- Add support for installing PowerShell Core on Amazon Linux via `install-powershell.sh`. (#5461) (Thanks @DarwinJS!)
|
||||
- Get `PowerShellGet` and `PackageManagement` from the PowerShell Gallery. (#5452)
|
||||
- Fix `Start-PSBuild` on `WSL` if repository was already built on Windows. (#5346) (Thanks @bergmeister!)
|
||||
- Fix build in VSCode and use an improved version of `tasks.json` from @rkeithhill. (#5453)
|
||||
- Add scripts for signing packages in the release build workflow. (#5463)
|
||||
|
||||
### Documentation and Help Content
|
||||
|
||||
- Fix the codebase to use the consistent copyright string. (#5210)
|
||||
- Add documentation about how to create `libpsl` and `psrp.windows` nuget packages. (#5278)
|
||||
- Add help strings in PowerShell banner. (#5275) (Thanks @iSazonov!)
|
||||
- Change all links in `README.md` to absolute as they are being used in other places outside of GitHub. (#5354)
|
||||
- Update instructions to build on VSCode based on `pwsh`. (#5368)
|
||||
- Update `FAQ.md` about how to use PowerShell Core nuget packages. (#5366)
|
||||
- Correct the Fedora documentation (#5384) (Thanks @offthewoll!)
|
||||
- Add instructions about how to create the `PowerShell.Core.Instrumentation` nuget package. (#5396)
|
||||
- Updated PowerShell to use the latest help package. (#5454)
|
||||
|
||||
### Compliance Work
|
||||
|
||||
[Compliance](https://github.com/PowerShell/PowerShell/blob/master/docs/maintainers/issue-management.md#miscellaneous-labels)
|
||||
work is required for Microsoft to continue to sign and release packages from the project as official Microsoft packages.
|
||||
|
||||
- Replace the word `hang` with something more appropriate and add rules about other terms. (#5213, #5297, #5358)
|
||||
- Use simplified names for compliance folders (#5388)
|
||||
- Add compliance label description (#5355)
|
||||
- Set `requestedExecutionLevel` to `asInvoker` for `pwsh.exe` on Windows. (#5285)
|
||||
- Add `HighEntropyVA` to building pwsh. (#5455)
|
||||
|
||||
## v6.0.0-beta.9 - 2017-10-24
|
||||
|
||||
### Breaking changes
|
||||
|
||||
@@ -53,20 +53,20 @@ You can also download the PowerShell binary archives for Windows, macOS and Linu
|
||||
| macOS | [64-bit][rl-macos-tar] | [Instructions][in-tar] |
|
||||
| Linux | [64-bit][rl-linux-tar] | [Instructions][in-tar] |
|
||||
|
||||
[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x64.msi
|
||||
[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x86.msi
|
||||
[rl-ubuntu17]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell_6.0.0-beta.9-1.ubuntu.17.04_amd64.deb
|
||||
[rl-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
|
||||
[rl-ubuntu14]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell_6.0.0-beta.9-1.ubuntu.14.04_amd64.deb
|
||||
[rl-debian8]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell_6.0.0-beta.9-1.debian.8_amd64.deb
|
||||
[rl-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell_6.0.0-beta.9-1.debian.9_amd64.deb
|
||||
[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
[rl-ai]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-x86_64.AppImage
|
||||
[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-osx.10.12-x64.pkg
|
||||
[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x86.zip
|
||||
[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x64.zip
|
||||
[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-osx-x64.tar.gz
|
||||
[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-linux-x64.tar.gz
|
||||
[rl-windows-64]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/PowerShell-6.0.0-rc-win-x64.msi
|
||||
[rl-windows-86]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/PowerShell-6.0.0-rc-win-x86.msi
|
||||
[rl-ubuntu17]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell_6.0.0-rc-1.ubuntu.17.04_amd64.deb
|
||||
[rl-ubuntu16]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell_6.0.0-rc-1.ubuntu.16.04_amd64.deb
|
||||
[rl-ubuntu14]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell_6.0.0-rc-1.ubuntu.14.04_amd64.deb
|
||||
[rl-debian8]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell_6.0.0-rc-1.debian.8_amd64.deb
|
||||
[rl-debian9]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell_6.0.0-rc-1.debian.9_amd64.deb
|
||||
[rl-centos]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
[rl-ai]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/PowerShell-6.0.0-rc-x86_64.AppImage
|
||||
[rl-macos]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0-rc-osx.10.12-x64.pkg
|
||||
[rl-winx86-zip]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/PowerShell-6.0.0-rc-win-x86.zip
|
||||
[rl-winx64-zip]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/PowerShell-6.0.0-rc-win-x64.zip
|
||||
[rl-macos-tar]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0-rc-osx-x64.tar.gz
|
||||
[rl-linux-tar]: https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0-rc-linux-x64.tar.gz
|
||||
|
||||
[installation]: https://github.com/PowerShell/PowerShell/tree/master/docs/installation
|
||||
[in-windows]: https://github.com/PowerShell/PowerShell/tree/master/docs/installation/windows.md#msi
|
||||
|
||||
+11
-3
@@ -377,7 +377,7 @@ function Start-PSBuild {
|
||||
|
||||
[switch]$CrossGen,
|
||||
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag
|
||||
)
|
||||
@@ -1604,7 +1604,7 @@ function Publish-NuGetFeed
|
||||
{
|
||||
param(
|
||||
[string]$OutputPath = "$PSScriptRoot/nuget-artifacts",
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag
|
||||
)
|
||||
@@ -1904,7 +1904,15 @@ function Get-PackageVersionAsMajorMinorBuildRevision
|
||||
} elseif (1 -lt $packageVersionTokens.Count) {
|
||||
# We have all the four fields
|
||||
$packageBuildTokens = ([regex]::Matches($packageVersionTokens[1], "\d+"))[0].value
|
||||
$packageVersion = $packageVersion + '.' + $packageBuildTokens
|
||||
|
||||
if ($packageBuildTokens)
|
||||
{
|
||||
$packageVersion = $packageVersion + '.' + $packageBuildTokens
|
||||
}
|
||||
else
|
||||
{
|
||||
$packageVersion = $packageVersion
|
||||
}
|
||||
}
|
||||
|
||||
$packageVersion
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
FROM amazonlinux:latest
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_PACKAGE=powershell-6.0.0-beta.9-linux-x64.tar.gz
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG POWERSHELL_PACKAGE=powershell-6.0.0-rc-linux-x64.tar.gz
|
||||
ARG IMAGE_NAME=microsoft/powershell:amazonlinux
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
FROM centos:7
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell:centos7
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
FROM fedora:25
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell:fedora25
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
FROM fedora:26
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell:fedora26
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -10,7 +10,7 @@ ARG NanoServerRepo=microsoft/nanoserver
|
||||
FROM ${WindowsServerCoreRepo}:$WindowsServerCoreVersion AS installer-env
|
||||
|
||||
# Arguments for installing powershell, must be defined in the container they are used
|
||||
ARG PS_VERSION=6.0.0-beta.9
|
||||
ARG PS_VERSION=6.0.0-rc
|
||||
|
||||
ENV PS_DOWNLOAD_URL https://github.com/PowerShell/PowerShell/releases/download/v$PS_VERSION/PowerShell-$PS_VERSION-win-x64.zip
|
||||
|
||||
@@ -25,7 +25,7 @@ RUN Expand-Archive powershell.zip -DestinationPath \PowerShell
|
||||
FROM ${NanoServerRepo}:$NanoServerVersion
|
||||
|
||||
ARG VCS_REF="none"
|
||||
ARG PS_VERSION=6.0.0-beta.9
|
||||
ARG PS_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" `
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
FROM opensuse:42.2
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_PACKAGE=powershell-6.0.0-beta.9-linux-x64.tar.gz
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG POWERSHELL_PACKAGE=powershell-6.0.0-rc-linux-x64.tar.gz
|
||||
ARG IMAGE_NAME=microsoft/powershell:opensuse42.2
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
FROM ubuntu:trusty
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell:ubuntu14.04
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
FROM ubuntu:xenial
|
||||
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell:ubuntu16.04
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" \
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# escape=`
|
||||
FROM microsoft/windowsservercore:latest
|
||||
|
||||
ARG POWERSHELL_MSI=https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/PowerShell-6.0.0-beta.9-win-x64.msi
|
||||
ARG POWERSHELL_VERSION=6.0.0-beta.9
|
||||
ARG POWERSHELL_MSI=https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/PowerShell-6.0.0-rc-win-x64.msi
|
||||
ARG POWERSHELL_VERSION=6.0.0-rc
|
||||
ARG IMAGE_NAME=microsoft/powershell:windowsservercore
|
||||
|
||||
LABEL maintainer="PowerShell Team <powershellteam@hotmail.com>" `
|
||||
|
||||
@@ -5,7 +5,7 @@ function Get-DockerEngineOs
|
||||
docker info --format '{{ .OperatingSystem }}'
|
||||
}
|
||||
|
||||
# Call Docker with appropriate result checksfunction Invoke-Docker
|
||||
# Call Docker with appropriate result checksfunction Invoke-Docker
|
||||
function Invoke-Docker
|
||||
{
|
||||
param(
|
||||
@@ -33,7 +33,7 @@ function Invoke-Docker
|
||||
{
|
||||
$result = docker $command $params 2>&1
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
&'docker' $command $params 2>&1 | Tee-Object -Variable result -ErrorAction SilentlyContinue | Out-String -Stream -ErrorAction SilentlyContinue | Write-Host -ErrorAction SilentlyContinue
|
||||
}
|
||||
@@ -58,7 +58,7 @@ function Invoke-Docker
|
||||
{
|
||||
return $false
|
||||
}
|
||||
|
||||
|
||||
return $true
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ function Get-LinuxContainer
|
||||
Path = "$psscriptroot/../release/$os"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
# Return a list of Windows Container Test Cases
|
||||
@@ -117,7 +117,7 @@ function Get-TestContext
|
||||
{
|
||||
param(
|
||||
[ValidateSet('Linux','Windows','macOS')]
|
||||
[string]$Type
|
||||
[string]$Type
|
||||
)
|
||||
|
||||
$resultFileName = 'results.xml'
|
||||
@@ -151,7 +151,7 @@ function Get-ContainerPowerShellVersion
|
||||
[string] $RepoName,
|
||||
[string] $Name
|
||||
)
|
||||
|
||||
|
||||
$imageTag = "${script:repoName}:${Name}"
|
||||
|
||||
if($TestContext.ForcePull)
|
||||
@@ -202,7 +202,7 @@ function Test-PSPackage
|
||||
[Parameter(Mandatory=$true)]
|
||||
$PSPackageLocation, # e.g. Azure storage
|
||||
[string]
|
||||
$PSVersion = "6.0.0-beta.9",
|
||||
$PSVersion = "6.0.0-rc",
|
||||
[string]
|
||||
$TestList = "/PowerShell/test/powershell/Modules/PackageManagement/PackageManagement.Tests.ps1,/PowerShell/test/powershell/engine/Module"
|
||||
)
|
||||
@@ -253,6 +253,6 @@ function Test-PSPackage
|
||||
# in the end print results for all configurations
|
||||
Write-Verbose "Package validation results:" -Verbose
|
||||
$results
|
||||
|
||||
|
||||
return $returnValue
|
||||
}
|
||||
|
||||
+51
-45
@@ -57,13 +57,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
|
||||
### Installation via Direct Download - Ubuntu 14.04
|
||||
|
||||
Download the Debian package
|
||||
`powershell_6.0.0-beta.9-1.ubuntu.14.04_amd64.deb`
|
||||
`powershell_6.0.0-rc-1.ubuntu.14.04_amd64.deb`
|
||||
from the [releases][] page onto the Ubuntu machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo dpkg -i powershell_6.0.0-beta.9-1.ubuntu.14.04_amd64.deb
|
||||
sudo dpkg -i powershell_6.0.0-rc-1.ubuntu.14.04_amd64.deb
|
||||
sudo apt-get install -f
|
||||
```
|
||||
|
||||
@@ -107,13 +107,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
|
||||
### Installation via Direct Download - Ubuntu 16.04
|
||||
|
||||
Download the Debian package
|
||||
`powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb`
|
||||
`powershell_6.0.0-rc-1.ubuntu.16.04_amd64.deb`
|
||||
from the [releases][] page onto the Ubuntu machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo dpkg -i powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
|
||||
sudo dpkg -i powershell_6.0.0-rc-1.ubuntu.16.04_amd64.deb
|
||||
sudo apt-get install -f
|
||||
```
|
||||
|
||||
@@ -157,13 +157,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
|
||||
### Installation via Direct Download - Ubuntu 17.04
|
||||
|
||||
Download the Debian package
|
||||
`powershell_6.0.0-beta.9-1.ubuntu.17.04_amd64.deb`
|
||||
`powershell_6.0.0-rc-1.ubuntu.17.04_amd64.deb`
|
||||
from the [releases][] page onto the Ubuntu machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo dpkg -i powershell_6.0.0-beta.9-1.ubuntu.17.04_amd64.deb
|
||||
sudo dpkg -i powershell_6.0.0-rc-1.ubuntu.17.04_amd64.deb
|
||||
sudo apt-get install -f
|
||||
```
|
||||
|
||||
@@ -211,13 +211,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
|
||||
### Installation via Direct Download - Debian 8
|
||||
|
||||
Download the Debian package
|
||||
`powershell_6.0.0-beta.9-1.debian.8_amd64.deb`
|
||||
`powershell_6.0.0-rc-1.debian.8_amd64.deb`
|
||||
from the [releases][] page onto the Debian machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo dpkg -i powershell_6.0.0-beta.9-1.debian.8_amd64.deb
|
||||
sudo dpkg -i powershell_6.0.0-rc-1.debian.8_amd64.deb
|
||||
sudo apt-get install -f
|
||||
```
|
||||
|
||||
@@ -265,13 +265,13 @@ from then on, you just need to use `sudo apt-get upgrade powershell` to update i
|
||||
### Installation via Direct Download - Debian 9
|
||||
|
||||
Download the Debian package
|
||||
`powershell_6.0.0-beta.9-1.debian.9_amd64.deb`
|
||||
`powershell_6.0.0-rc-1.debian.9_amd64.deb`
|
||||
from the [releases][] page onto the Debian machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo dpkg -i powershell_6.0.0-beta.9-1.debian.9_amd64.deb
|
||||
sudo dpkg -i powershell_6.0.0-rc-1.debian.9_amd64.deb
|
||||
sudo apt-get install -f
|
||||
```
|
||||
|
||||
@@ -310,19 +310,19 @@ you just need to use `sudo yum update powershell` to update PowerShell.
|
||||
### Installation via Direct Download - CentOS 7
|
||||
|
||||
Using [CentOS 7][], download the RPM package
|
||||
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
|
||||
`powershell-6.0.0_rc-1.rhel.7.x86_64.rpm`
|
||||
from the [releases][] page onto the CentOS machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo yum install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo yum install powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
You can also install the RPM without the intermediate step of downloading it:
|
||||
|
||||
```sh
|
||||
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
### Uninstallation - CentOS 7
|
||||
@@ -356,19 +356,19 @@ you just need to use `sudo yum update powershell` to update PowerShell.
|
||||
### Installation via Direct Download - Red Hat Enterprise Linux (RHEL) 7
|
||||
|
||||
Download the RPM package
|
||||
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
|
||||
`powershell-6.0.0_rc-1.rhel.7.x86_64.rpm`
|
||||
from the [releases][] page onto the Red Hat Enterprise Linux machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo yum install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo yum install powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
You can also install the RPM without the intermediate step of downloading it:
|
||||
|
||||
```sh
|
||||
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo yum install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
### Uninstallation - Red Hat Enterprise Linux (RHEL) 7
|
||||
@@ -407,19 +407,19 @@ pwsh
|
||||
|
||||
### Installation via Direct Download - OpenSUSE 42.2
|
||||
|
||||
Download the RPM package `powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
|
||||
Download the RPM package `powershell-6.0.0_rc-1.rhel.7.x86_64.rpm`
|
||||
from the [releases][] page onto the OpenSUSE machine.
|
||||
|
||||
```sh
|
||||
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||
sudo zypper install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo zypper install powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
You can also install the RPM without the intermediate step of downloading it:
|
||||
|
||||
```sh
|
||||
sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc
|
||||
sudo zypper install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo zypper install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
### Uninstallation - OpenSUSE 42.2
|
||||
@@ -454,19 +454,19 @@ pwsh
|
||||
### Installation via Direct Download - Fedora 25
|
||||
|
||||
Download the RPM package
|
||||
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
|
||||
`powershell-6.0.0_rc-1.rhel.7.x86_64.rpm`
|
||||
from the [releases][] page onto the Fedora machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```sh
|
||||
sudo dnf install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo dnf install powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
You can also install the RPM without the intermediate step of downloading it:
|
||||
|
||||
```sh
|
||||
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
### Uninstallation - Fedora 25
|
||||
@@ -504,7 +504,7 @@ pwsh
|
||||
### Installation via Direct Download - Fedora 26
|
||||
|
||||
Download the RPM package
|
||||
`powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm`
|
||||
`powershell-6.0.0_rc-1.rhel.7.x86_64.rpm`
|
||||
from the [releases][] page onto the Fedora machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
@@ -512,7 +512,7 @@ Then execute the following in the terminal:
|
||||
```sh
|
||||
sudo dnf update
|
||||
sudo dnf install compat-openssl10
|
||||
sudo dnf install powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo dnf install powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
You can also install the RPM without the intermediate step of downloading it:
|
||||
@@ -520,7 +520,7 @@ You can also install the RPM without the intermediate step of downloading it:
|
||||
```sh
|
||||
sudo dnf update
|
||||
sudo dnf install compat-openssl10
|
||||
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0_beta.9-1.rhel.7.x86_64.rpm
|
||||
sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0_rc-1.rhel.7.x86_64.rpm
|
||||
```
|
||||
|
||||
### Uninstallation - Fedora 26
|
||||
@@ -549,14 +549,14 @@ For more information on installing packages from the AUR, see the [Arch Linux wi
|
||||
## Linux AppImage
|
||||
|
||||
Using a recent Linux distribution,
|
||||
download the AppImage `powershell-6.0.0-beta.9-x86_64.AppImage`
|
||||
download the AppImage `powershell-6.0.0-rc-x86_64.AppImage`
|
||||
from the [releases][] page onto the Linux machine.
|
||||
|
||||
Then execute the following in the terminal:
|
||||
|
||||
```bash
|
||||
chmod a+x powershell-6.0.0-beta.9-x86_64.AppImage
|
||||
./powershell-6.0.0-beta.9-x86_64.AppImage
|
||||
chmod a+x powershell-6.0.0-rc-x86_64.AppImage
|
||||
./powershell-6.0.0-rc-x86_64.AppImage
|
||||
```
|
||||
|
||||
The [AppImage][] lets you run PowerShell without installing it.
|
||||
@@ -604,14 +604,14 @@ brew cask reinstall powershell
|
||||
### Installation via Direct Download - macOS 10.12
|
||||
|
||||
Using macOS 10.12, download the PKG package
|
||||
`powershell-6.0.0-beta.9-osx.10.12-x64.pkg`
|
||||
`powershell-6.0.0-rc-osx.10.12-x64.pkg`
|
||||
from the [releases][] page onto the macOS machine.
|
||||
|
||||
Either double-click the file and follow the prompts,
|
||||
or install it from the terminal:
|
||||
|
||||
```sh
|
||||
sudo installer -pkg powershell-6.0.0-beta.9-osx.10.12-x64.pkg -target /
|
||||
sudo installer -pkg powershell-6.0.0-rc-osx.10.12-x64.pkg -target /
|
||||
```
|
||||
|
||||
### Uninstallation - macOS 10.12
|
||||
@@ -647,7 +647,7 @@ wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libs
|
||||
dpkg -i libssl1.0.0_1.0.1t-1+deb8u6_amd64.deb
|
||||
|
||||
# Install PowerShell
|
||||
dpkg -i powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
|
||||
dpkg -i powershell_6.0.0-rc-1.ubuntu.16.04_amd64.deb
|
||||
|
||||
# Start PowerShell
|
||||
pwsh
|
||||
@@ -657,19 +657,19 @@ pwsh
|
||||
|
||||
```sh
|
||||
# Grab the latest App Image
|
||||
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-x86_64.AppImage
|
||||
wget https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0-rc-x86_64.AppImage
|
||||
|
||||
# Make executable
|
||||
chmod a+x powershell-6.0.0-beta.9-x86_64.AppImage
|
||||
chmod a+x powershell-6.0.0-rc-x86_64.AppImage
|
||||
|
||||
# Start PowerShell
|
||||
./powershell-6.0.0-beta.9-x86_64.AppImage
|
||||
./powershell-6.0.0-rc-x86_64.AppImage
|
||||
```
|
||||
|
||||
### Uninstallation - Kali
|
||||
|
||||
```sh
|
||||
dpkg -r powershell_6.0.0-beta.9-1.ubuntu.16.04_amd64.deb
|
||||
dpkg -r powershell_6.0.0-rc-1.ubuntu.16.04_amd64.deb
|
||||
```
|
||||
|
||||
## Binary Archives
|
||||
@@ -707,32 +707,38 @@ and then extracts the Linux `tar.gz` archive.
|
||||
|
||||
```sh
|
||||
# Download the powershell '.tar.gz' archive
|
||||
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-linux-x64.tar.gz
|
||||
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0-rc-linux-x64.tar.gz
|
||||
|
||||
# Create the target folder where powershell will be placed
|
||||
sudo mkdir -p /opt/microsoft/powershell/6.0.0-beta.9
|
||||
sudo mkdir -p /opt/microsoft/powershell/6.0.0-rc
|
||||
|
||||
# Expand powershell to the target folder
|
||||
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.0.0-beta.9
|
||||
sudo tar zxf /tmp/powershell.tar.gz -C /opt/microsoft/powershell/6.0.0-rc
|
||||
|
||||
# Set execute permissions
|
||||
sudo chmod +x /usr/local/microsoft/powershell/6.0.0-rc/pwsh
|
||||
|
||||
# Create the symbolic link that points to pwsh
|
||||
sudo ln -s /opt/microsoft/powershell/6.0.0-beta.9/pwsh /usr/bin/pwsh
|
||||
sudo ln -s /opt/microsoft/powershell/6.0.0-rc/pwsh /usr/bin/pwsh
|
||||
```
|
||||
|
||||
#### macOS
|
||||
|
||||
```sh
|
||||
# Download the powershell '.tar.gz' archive
|
||||
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-beta.9/powershell-6.0.0-beta.9-osx-x64.tar.gz
|
||||
curl -L -o /tmp/powershell.tar.gz https://github.com/PowerShell/PowerShell/releases/download/v6.0.0-rc/powershell-6.0.0-rc-osx-x64.tar.gz
|
||||
|
||||
# Create the target folder where powershell will be placed
|
||||
sudo mkdir -p /usr/local/microsoft/powershell/6.0.0-beta.9
|
||||
sudo mkdir -p /usr/local/microsoft/powershell/6.0.0-rc
|
||||
|
||||
# Expand powershell to the target folder
|
||||
sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/6.0.0-beta.9
|
||||
sudo tar zxf /tmp/powershell.tar.gz -C /usr/local/microsoft/powershell/6.0.0-rc
|
||||
|
||||
# Set execute permissions
|
||||
sudo chmod +x /usr/local/microsoft/powershell/6.0.0-rc/pwsh
|
||||
|
||||
# Create the symbolic link that points to pwsh
|
||||
sudo ln -s /usr/local/microsoft/powershell/6.0.0-beta.9/pwsh /usr/local/bin/pwsh
|
||||
sudo ln -s /usr/local/microsoft/powershell/6.0.0-rc/pwsh /usr/local/bin/pwsh
|
||||
```
|
||||
|
||||
### Uninstallation - Binary Archives
|
||||
@@ -751,7 +757,7 @@ sudo rm -rf /usr/local/bin/pwsh /usr/local/microsoft/powershell
|
||||
|
||||
## Paths
|
||||
|
||||
* `$PSHOME` is `/opt/microsoft/powershell/6.0.0-beta.9/`
|
||||
* `$PSHOME` is `/opt/microsoft/powershell/6.0.0-rc/`
|
||||
* User profiles will be read from `~/.config/powershell/profile.ps1`
|
||||
* Default profiles will be read from `$PSHOME/profile.ps1`
|
||||
* User modules will be read from `~/.local/share/powershell/Modules`
|
||||
@@ -766,7 +772,7 @@ On Linux and macOS, the [XDG Base Directory Specification][xdg-bds] is respected
|
||||
|
||||
Note that because macOS is a derivation of BSD,
|
||||
instead of `/opt`, the prefix used is `/usr/local`.
|
||||
Thus, `$PSHOME` is `/usr/local/microsoft/powershell/6.0.0-beta.9/`,
|
||||
Thus, `$PSHOME` is `/usr/local/microsoft/powershell/6.0.0-rc/`,
|
||||
and the symlink is placed at `/usr/local/bin/pwsh`.
|
||||
|
||||
[releases]: https://github.com/PowerShell/PowerShell/releases/latest
|
||||
|
||||
@@ -80,7 +80,7 @@ The `Start-PSPackage` function delegates to `New-UnixPackage`.
|
||||
It relies on the [Effing Package Management][fpm] project,
|
||||
which makes building packages for any (non-Windows) platform a breeze.
|
||||
Similarly, the PowerShell man-page is generated from the Markdown-like file
|
||||
[`assets/powershell.1.ronn`][man] using [Ronn][].
|
||||
[`assets/pwsh.1.ronn`][man] using [Ronn][].
|
||||
The function `Start-PSBootstrap -Package` will install both these tools.
|
||||
|
||||
To modify any property of the packages, edit the `New-UnixPackage` function.
|
||||
@@ -94,7 +94,7 @@ license, category, dependencies, and file layout).
|
||||
To support side-by-side Unix packages, we use the following design:
|
||||
|
||||
We will maintain a `powershell` package
|
||||
which owns the `/usr/bin/powershell` symlink,
|
||||
which owns the `/usr/bin/pwsh` symlink,
|
||||
is the latest version, and is upgradeable.
|
||||
This is the only package named `powershell`
|
||||
and similarly is the only package owning any symlinks,
|
||||
@@ -136,7 +136,7 @@ Without `-Name` specified, the primary `powershell`
|
||||
package will instead be created.
|
||||
|
||||
[fpm]: https://github.com/jordansissel/fpm
|
||||
[man]: ../../assets/powershell.1.ronn
|
||||
[man]: ../../assets/pwsh.1.ronn
|
||||
[ronn]: https://github.com/rtomayko/ronn
|
||||
|
||||
### Build and Packaging Examples
|
||||
@@ -177,10 +177,7 @@ In the `release` branch, run `Publish-NuGetFeed` to generate PowerShell NuGet pa
|
||||
|
||||
```powershell
|
||||
# Assume the to-be-used release tag is 'v6.0.0-beta.1'
|
||||
$VersionSuffix = ("v6.0.0-beta.1" -split '-')[-1]
|
||||
|
||||
# Generate NuGet packages
|
||||
Publish-NuGetFeed -VersionSuffix $VersionSuffix
|
||||
Publish-NuGetFeed -ReleaseTag 'v6.0.0-beta.1'
|
||||
```
|
||||
|
||||
PowerShell NuGet packages and the corresponding symbol packages will be generated at `PowerShell/nuget-artifacts` by default.
|
||||
|
||||
@@ -11,7 +11,7 @@ function Start-PSPackage {
|
||||
[string]$Version,
|
||||
|
||||
[Parameter(ParameterSetName = "ReleaseTag")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag,
|
||||
|
||||
@@ -457,7 +457,7 @@ function New-PSSignedBuildZip
|
||||
log "Setting $VstsVariableName to $zipLocationPath"
|
||||
Write-Host "##vso[task.setvariable variable=$VstsVariableName]$zipLocationPath"
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
return $zipLocationPath
|
||||
}
|
||||
@@ -1088,10 +1088,10 @@ function Get-PackageSemanticVersion
|
||||
Write-Verbose "Extract the semantic version in the form of major.minor[.build-quality[.revision]] for $Version"
|
||||
$packageVersionTokens = $Version.Split('.')
|
||||
|
||||
if (3 -eq $packageVersionTokens.Count) {
|
||||
# In case the input is of the form a.b.c, add a '0' at the end for revision field
|
||||
$packageSemanticVersion = $Version,'0' -join '.'
|
||||
} elseif (3 -lt $packageVersionTokens.Count) {
|
||||
if ($packageVersionTokens.Count -eq 3) {
|
||||
# In case the input is of the form a.b.c, we use the same form
|
||||
$packageSemanticVersion = $Version
|
||||
} elseif ($packageVersionTokens.Count -eq 4) {
|
||||
# We have all the four fields
|
||||
$packageRevisionTokens = ($packageVersionTokens[3].Split('-'))[0]
|
||||
if($NuGet.IsPresent)
|
||||
|
||||
@@ -8,7 +8,7 @@ param (
|
||||
# Destination location of the package on docker host
|
||||
[string] $destination = '/mnt',
|
||||
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag,
|
||||
|
||||
@@ -27,7 +27,7 @@ try {
|
||||
Set-Location $location
|
||||
Import-Module "$location/build.psm1"
|
||||
Import-Module "$location/tools/packaging"
|
||||
|
||||
|
||||
Start-PSBootstrap -Package -NoSudo
|
||||
Start-PSBuild -Crossgen -PSModuleRestore @releaseTagParam
|
||||
|
||||
|
||||
+1
-1
@@ -14,7 +14,7 @@ param (
|
||||
|
||||
[switch] $Wait,
|
||||
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag,
|
||||
|
||||
|
||||
@@ -0,0 +1,65 @@
|
||||
# PowerShell Script to build and package PowerShell from specified form and branch
|
||||
# Script is intented to use in Docker containers
|
||||
# Ensure PowerShell is available in the provided image
|
||||
|
||||
param (
|
||||
# Set default location to where VSTS cloned the repository locally.
|
||||
[string] $location = $env:BUILD_REPOSITORY_LOCALPATH,
|
||||
|
||||
# Destination location of the package on docker host
|
||||
[string] $destination = '/mnt',
|
||||
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[ValidateNotNullOrEmpty()]
|
||||
[string]$ReleaseTag,
|
||||
|
||||
[ValidateSet("zip", "tar")]
|
||||
[string[]]$ExtraPackage
|
||||
)
|
||||
|
||||
# We must build in /PowerShell
|
||||
|
||||
# cleanup the folder but don't delete it or the build agent will loose ownership of the folder
|
||||
Get-ChildItem -Path /PowerShell/* -Attributes Hidden,Normal,Directory | Remove-Item -Recurse -Force
|
||||
|
||||
# clone the repositor to the location we must build from
|
||||
git clone $location /PowerShell
|
||||
|
||||
$releaseTagParam = @{}
|
||||
if ($ReleaseTag)
|
||||
{
|
||||
$releaseTagParam = @{ 'ReleaseTag' = $ReleaseTag }
|
||||
}
|
||||
|
||||
Push-Location
|
||||
try {
|
||||
Set-Location /PowerShell
|
||||
Import-Module "/PowerShell/build.psm1"
|
||||
Import-Module "/PowerShell/tools/packaging"
|
||||
|
||||
Start-PSBootstrap -Package -NoSudo
|
||||
Start-PSBuild -Crossgen -PSModuleRestore @releaseTagParam
|
||||
|
||||
Start-PSPackage @releaseTagParam
|
||||
switch ($ExtraPackage)
|
||||
{
|
||||
"zip" { Start-PSPackage -Type zip @releaseTagParam }
|
||||
"tar" { Start-PSPackage -Type tar @releaseTagParam }
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
Pop-Location
|
||||
}
|
||||
|
||||
$linuxPackages = Get-ChildItem "/PowerShell/powershell*" -Include *.pkg,*.zip,*.tar.gz
|
||||
foreach ($linuxPackage in $linuxPackages)
|
||||
{
|
||||
$filePath = $linuxPackage.FullName
|
||||
$name = split-path -Leaf -Path $filePath
|
||||
$extension = (Split-Path -Extension -Path $filePath).Replace('.','')
|
||||
Write-Verbose "Copying $filePath to $destination" -Verbose
|
||||
Write-Host "##vso[artifact.upload containerfolder=results;artifactname=$name]$filePath"
|
||||
Write-Host "##vso[task.setvariable variable=Package-$extension]$filePath"
|
||||
Copy-Item -Path $filePath -Destination $destination -force
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
pwsh -command ".\PowerShellPackage.ps1 $*"
|
||||
@@ -2,7 +2,7 @@
|
||||
param(
|
||||
[Parameter(ParameterSetName='packageSigned')]
|
||||
[Parameter(ParameterSetName='Build')]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+\.\d+)?$")]
|
||||
[ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")]
|
||||
[string]$ReleaseTag,
|
||||
|
||||
# full paths to files to add to container to run the build
|
||||
@@ -33,7 +33,7 @@ DynamicParam {
|
||||
$Attributes = New-Object "System.Collections.ObjectModel.Collection``1[System.Attribute]"
|
||||
$Attributes.Add($ParameterAttr) > $null
|
||||
$Attributes.Add($ValidateSetAttr) > $null
|
||||
|
||||
|
||||
# Create the parameter
|
||||
$Parameter = New-Object "System.Management.Automation.RuntimeDefinedParameter" -ArgumentList ("Name", [string], $Attributes)
|
||||
$Dict = New-Object "System.Management.Automation.RuntimeDefinedParameterDictionary"
|
||||
@@ -57,7 +57,7 @@ End {
|
||||
Import-Module (Join-Path -path $PSScriptRoot -childpath '..\packaging')
|
||||
|
||||
# Use temp as destination if not running in VSTS
|
||||
$destFolder = $env:temp
|
||||
$destFolder = $env:temp
|
||||
if($env:Build_ArtifactStagingDirectory)
|
||||
{
|
||||
# Use artifact staging if running in VSTS
|
||||
@@ -101,7 +101,7 @@ End {
|
||||
$unresolvedRepoRoot = Join-Path -Path $PSScriptRoot '../..'
|
||||
$resolvedRepoRoot = (Resolve-Path -Path $unresolvedRepoRoot).ProviderPath
|
||||
|
||||
try
|
||||
try
|
||||
{
|
||||
Write-Verbose "Starting build at $resolvedRepoRoot ..." -Verbose
|
||||
Import-Module "$location/vstsBuild" -Force
|
||||
|
||||
Reference in New Issue
Block a user