Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install latest version of Nodepad++ via PowerShell, inspired by:
$res = Invoke-WebRequest
if ($res.StatusCode -ne 200) {throw ("status code to getDownloadUrl was not 200: "+$res.StatusCode)}
$dlurl = ($res.Content | Select-Xml /GUP/Location).node.InnerXML
$installerPath = Join-Path $env:TEMP (Split-Path $dlurl -Leaf)
Invoke-WebRequest $dlurl -OutFile $installerPath
Start-Process -FilePath $installerPath -Args "/S" -Verb RunAs -Wait
Remove-Item $installerPath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.