WOL:
$ProgressPreference = "SilentlyContinue"
$Link = "https://www.nirsoft.net/utils/wakemeonlan-x64.zip"
$Path = "C:\Users\Public\Downloads"
$File = "wakemeonlan-x64.zip"
$Product = "WakeMeOnLan"
if (Test-Path $Path\$File) {
Remove-Item $Path\$File
}
if (Test-Path $Path\$Product) {
Remove-Item $Path\$Product -recurse
}
Invoke-WebRequest -Uri $Link -OutFile $Path\$File -UseBasicParsing
Expand-Archive $Path\$File $Path\$Product
Start-Process -FilePath $Path\$Product\$Product.exe -ArgumentList "/scan"
With proxy:
$ProgressPreference = "SilentlyContinue"
$Link = "https://www.nirsoft.net/utils/wakemeonlan-x64.zip"
$Path = "C:\Users\Public\Downloads"
$File = "wakemeonlan-x64.zip"
$Product = "WakeMeOnLan"
if (Test-Path $Path\$File) {
Remove-Item $Path\$File
}
if (Test-Path $Path\$Product) {
Remove-Item $Path\$Product -recurse
}
Invoke-WebRequest -Uri $Link -Proxy http://proxy.ezorg.nl:8080 -ProxyUseDefaultCredentials -OutFile $Path\$File -UseBasicParsing
Expand-Archive $Path\$File $Path\$Product
Start-Process -FilePath $Path\$Product\$Product.exe -ArgumentList "/scan"