Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command Prompt: access denied when run PowerShell

I got a problem when try to run powershell from command line. I typed powershell.exe when pop up window shows up in blue background saying: "This app cant run on your PC, to find version for your PC check publisher". Then command prompt gives message: "Access is denied."

Any suggestions would be highly appreciated.

like image 660
hackForLife Avatar asked Oct 19 '22 04:10

hackForLife


1 Answers

My problem was that C:/windows/system32/powershell.exe was invalid as you can see on the image below:

enter image description here

I could found the right executable in C:\Windows\System32\WindowsPowerShell\v1.0\.

So if this is your problem, try the following:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe .\my-script.ps1

Instead of this:

powershell.exe .\my-script.ps1
like image 125
fabriciorissetto Avatar answered Oct 30 '22 14:10

fabriciorissetto