简体   繁体   中英

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.

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

在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM