Module.Template 2.0.4 Update

This commit is contained in:
ili101
2019-10-07 16:09:37 +03:00
parent 9afc1dbec2
commit 394210d41f
5 changed files with 84 additions and 15 deletions

26
CI/InstallPowerShell.ps1 Normal file
View File

@@ -0,0 +1,26 @@
<#
.SYNOPSIS
Installs PowerShell Core on Windows.
#>
[CmdLetBinding()]
Param
(
# Version to install in the format from the .msi, for example "7.0.0-preview.1"
[Parameter(Mandatory)]
[String]$Version
)
$ErrorActionPreference = 'Stop'
'[Progress] Downloading PowerShell Core.'
$MsiPath = Join-Path $env:TEMP "PowerShell-$Version-win-x64.msi"
[System.Net.WebClient]::new().DownloadFile("https://github.com/PowerShell/PowerShell/releases/download/v$Version/PowerShell-$Version-win-x64.msi", $MsiPath)
'[Progress] Installing PowerShell Core.'
Start-Process 'msiexec.exe' -Wait -ArgumentList "/i $MsiPath /quiet"
Remove-Item -Path $MsiPath
$PowerShellFolder = $Version[0]
if ($Version -like "*preview*") {
$PowerShellFolder += '-preview'
}
$env:Path = "$env:ProgramFiles\PowerShell\$PowerShellFolder;$env:Path"
'[Progress] PowerShell Core Installed.'