Created
May 2, 2021 12:37
-
-
Save numbnet/c70f849ae7e913159a6b3217e7ec6627 to your computer and use it in GitHub Desktop.
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
if ((Get-WmiObject win32_operatingsystem | select osarchitecture).osarchitecture -like "64*") | |
{ | |
Write "... for Windows x64" | |
$OSx = 'x64' | |
} else { | |
Write "... for Windows x86" | |
$OSx = 'x86' | |
} | |
$FileName = "PowerShell-7.2.0-preview.5-win-$OSx.msi" | |
$DirLoad = "PS\PowerShell" | |
$DownLink = "https://github.com/PowerShell/PowerShell/releases/download/v7.2.0-preview.5/PowerShell-7.2.0-preview.5-win-$OSx.msi" | |
New-Item -Path "$env:SYSTEMDRIVE\" -Name "$DirLoad" -ItemType Directory | |
Invoke-WebRequest -Uri "$DownLink" -OutFile "$env:SYSTEMDRIVE\$DirLoad\$FileName" | |
start "$env:SYSTEMDRIVE\$DirLoad\$FileName" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment