Last active
August 2, 2019 23:44
-
-
Save kilasuit/7ce30e04c7809aa5084d404d6d6d3bc5 to your computer and use it in GitHub Desktop.
Showing a slightly safer way to install PowerShell instead of using IEX though still brings the same similar problems as IEX does
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$wr = invoke-webrequest https://raw.githubusercontent.com/PowerShell/PowerShell/master/tools/install-powershell.ps1 | |
$sbuilder = [System.Text.StringBuilder]::new() | |
$sbuilder.AppendLine('function Install-ps {'} | |
$sbuilder.AppendLine($wr.content) | |
$sbuilder.AppendLine('}') | |
$sbuilder.AppendLine('') | |
$sbuilder.AppendLine('Install-ps -UseMSI -Preview') #Replace this with whatever switches you want to run instead from the ones available in the above script | |
$nsb = [Scriptblock]::Create($sbuilder.ToString()) | |
. $nsb | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Error Line 4 -> Replace } with )