Update Powershell Version

function Test-Administrator $currentUser = [Security.Principal.WindowsIdentity]::GetCurrent() $principal = New-Object Security.Principal.WindowsPrincipal($currentUser) return $principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)

$msiArguments = @( "/i `"$InstallerPath`"", "/quiet", "/norestart", "ADD_EXPLORER_CONTEXT_MENU_OPENPOWERSHELL=1", "ENABLE_PSREMOTING=1", "REGISTER_MANIFEST=1" ) update powershell version

if ($os -eq "Unknown") Write-ColorOutput "Unsupported operating system!" "Red" exit 1 function Test-Administrator $currentUser = [Security

Before updating, you need to know which version you are currently running. Open PowerShell. Type the following command and press : powershell $PSVersionTable.PSVersion Use code with caution. "LTS")] [string]$Channel = "Stable"

[Parameter(Mandatory = $false)] [ValidateSet("Stable", "LTS")] [string]$Channel = "Stable"