Set your execution policy to remotesigned.
powershell is not working in window11
When I run PowerShell in window11, its show "This operation has been cancelled due to restrictions in effect on this computer.Please contact your system administrator." I don't know how to solve this problem. Please, guide me. Thanks.
3 answers
Sort by: Most helpful
-
-
Andreas Baumgarten 107.9K Reputation points MVP
2022-02-19T15:30:53.23+00:00 Hi @Myo Winn Kyaw ,
maybe this is helpful for you: https://www.surfacetablethelp.com/2018/04/cannot-open-powershell-on-windows-10-due-to-restrictions-in-effect.html
Even if this is for Windows 10 it should be the same in Windows 11.
----------
(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)
Regards
Andreas Baumgarten -
Ronen Ariely 15,191 Reputation points
2022-02-19T16:26:24.21+00:00 Hi,
ERROR:
This operation has been cancelled due to restrictions in effect on this computer. Please contact your system administrator.
Explanation:
programs can be restricted in Windows through the Registry or through Group Policy.
Workaround
Recommended as first test and check if this fit your future need as well.
(1) Try to run powershell from winsows terminal
Windows Terminal (or simply "Terminal") has developed for Windows 10 as a replacement for Windows Console and is the default in windows 11. It is preconfigured to run Command Prompt, PowerShell, WSL, SSH, and Azure Cloud Shell Connector.
To run powershell command you can open the Terminal and run the command:
powershell
To open the Termical: press WINDOWS + S to launch the Search menu -> enter ‘Terminal’ in the text field at the top
(2) run powershell as administrator or using a user which is administrator
You can run the Terminal as administrator if you need to run powershell as administrator: right-click on the relevant search result, and select ‘Run as administrator’ from the context menu.
You can also try to run PowerShell as administrator directly: search for PowerShell -> right-click on the relevant search result, and select ‘Run as administrator’
Solution for simple users:
If you are the administrator then you can edit the registry or change the group policy.
(1) To edit the group policy, run the command gpedit.msc
Note: Windows 11 Home Edition does not come with Group Policy Editor (gpedit.msc) pre-installed.
If the group policy editor is not installed then you will get the error: "Windows cannot find ‘gpedit.msc’. Make sure you typed the name correctly, and then try again."
Expand User Configuration.
Expand Administrative Templates.
Expand System.
On the right-hand side locate a setting called "Don’t run specified Windows applications".
Double-click that setting and change it to Not Configured.
(2) Making changes to the registry
THIS IS NOT RECOMMENDED if you are not fully understand what you are doming and fully aware of the consequences! In any case, before changing the registry ALWAYS backup the registry.
to make changes in the registry, open the registry editor by run the command: regedit
Find \HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\ and delete the key called "DisallowRun" on your own responsibility
----------
Ronen Ariely
Personal Site | Blog | Facebook | Linkedin