Update Powershell Version 〈HOT ⟶〉
function Get-CurrentPowerShellVersion $version = $PSVersionTable.PSVersion return "$($version.Major).$($version.Minor).$($version.Patch)"
function Get-AssetPattern param([string]$OS) update powershell version
Write-ColorOutput "Installing PowerShell on Windows..." "Cyan" update powershell version
Clear-Host Write-ColorOutput "========================================" "Cyan" Write-ColorOutput " PowerShell Update Tool v2.0" "Cyan" Write-ColorOutput "========================================" "Cyan" Write-ColorOutput "" $os = Get-OSPlatform Write-ColorOutput "Detected OS: $os" "Yellow" Write-ColorOutput "Current PowerShell Version: $(Get-CurrentPowerShellVersion)" "Yellow" update powershell version
function Download-PowerShellInstaller param( [string]$DownloadUrl, [string]$DestinationPath )