Create and Run PowerShell script

Often we need to write certain scripts to automate certain process. Below is the step to create a PS script.

First create a script file with the extension of .ps1. Eg: MyScript.ps1

Next to run the script, we navigate to the file path, then enter a period followed by a blackslash. Eg: ./MyScript.ps1

set-executionpolicy remotesigned

You may revert the above as followed

set-executionpolicy undefined
By using our website you are consenting to our use of cookies to ensure you get the best experience on our website. Learn more