In yesterday’s article, I posted a script which can be used to download and delete files from a folder on an FTP site. When I tested it on one computer it worked fine, but on another it failed as the running of PowerShell is restricted. To avoid this error the PowerShell script can be saved to a file with a
powershell -executionpolicy bypass -File "download files.ps1"
This will bypass the execution policy restricting the script from running and allow it to run without issue.
Click to show/hide the PowerShell Snippets Series Index
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.
2 thoughts on “PowerShell to run script bypassing execution policy”