There are not many cases when you need to execute a Power Shell script (*.PS1 file) as Administrator. But when you need it, it can be tricky. Instead of just double clicking your PS1 file, you need to open an elevated Power Shell console and type the name of the PS1 script file at the correct path to execute the script as admin. To avoid this, you can add a context menu command for PS1 files to the File Explorer app which will allow you to run the selected PS1 file as administrator. Here is how.
Advertisement