<# This script runs a remote GPUpdate Alan Kaplan 8/6/21 #> param ( [Parameter(Mandatory = $True)] [string]$PCfqdn ) Try { $s = New-PSSession -ComputerName $PCfqdn -ErrorAction Stop } Catch { Write-Warning $_ Pause Exit } invoke-command -ScriptBlock { & cmd /c "C:\windows\system32\gpupdate.exe" /force } -Session $s Get-PSSession | Remove-PSSession Write-Host "Done" -foregroundColor green Pause