Every time I get a new computer or rebuild one and try to run a Powershell script that I wrote, it fails. This always frustrates me since I’m usually an administrator on my own computer. I have no idea why the Powershell app does not make this as easy as a menu item to fix so I will show you the two steps you need to do to fix it.
1. Restart Powershell as Admin
The first step is to run Powershell as administrator. I always pin it to my Task Bar, so just right mouse click on its icon and select Run as Administrator.
2. Fix permission
Next, run this command to fix the permissions.
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachin
Now you can run Powershell scripts!
Pick up any books by David McCarter by going to Amazon.com: http://bit.ly/RockYourCodeBooks
Make a one-time donation
Make a monthly donation
Make a yearly donation
Choose an amount
Or enter a custom amount
Your contribution is appreciated.
Your contribution is appreciated.
Your contribution is appreciated.
DonateDonate monthlyDonate yearlyIf you liked this article, please buy David a cup of Coffee by going here: https://www.buymeacoffee.com/dotnetdave
© The information in this article is copywritten and cannot be preproduced in any way without express permission from David McCarter.
Discover more from dotNetTips.com
Subscribe to get the latest posts sent to your email.

Holding Ctrl+Shift while starting an app from the Start menu or the taskbar is a shortcut for “Run as Administrator”. Saves some time.