Windows Batch Script: Download file using powershell








SET "url=https://your-site.org/a-file.zip"
SET "out=C:\Downloads"
POWERSHELL -COMMAND "[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true};(New-Object Net.WebClient).DownloadFile('%url%', '%out%')"
NOTE: [System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true} bypass the SSL certificate validation.










See also




No comments:

Post a Comment