0

Code snippets : PowerShell : Changing script execution policy

-

Handy quick one to change script execution policy for PowerShell:

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force

Now all scripts should work fine 🙂

0

Code snippets : Downloading file from URL in PowerShell

-

To download file from URL I used following piece of code:

$fileURL = "http://server/file.zip"
$fileName = "C:\Downloads\file.zip"
$webclient = New-Object System.Net.WebClient
$webclient.DownloadFile($fileURL,$fileName)