Update Powershell Version __top__ -
function Get-OSPlatform if ($env:OS -eq "Windows_NT") return "Windows"
function Get-LatestPowerShellVersion param( [bool]$IncludePreview = $false, [string]$Channel = "Stable" ) update powershell version
[Parameter(Mandatory = $false)] [switch]$Preview, [Parameter(Mandatory = $false)] [switch]$NoRestart
[Parameter(Mandatory = $false)] [switch]$NoRestart, update powershell version
try $webClient = New-Object System.Net.WebClient $webClient.DownloadFile($DownloadUrl, $DestinationPath) Write-ColorOutput "Download completed: $DestinationPath" "Green" return $true
function Write-ColorOutput param( [string]$Message, [string]$Color = "White" ) Write-Host $Message -ForegroundColor $Color