Win10 Tip: Add Administrator Permissions to the right-click menu of the PS1 file.

  

Many professional users like to use PowerShell. The file format of this tool is “.ps1”. Since in many cases PowerShell files require administrator privileges to solve system problems, such as Win10 application issues, it is useful to add the option "Run as administrator" to its right-click menu. PepsiCo Xiaobian today tells you how to add this option.

It is to use the registry. Although the following steps may seem more complicated, it is not troublesome, as follows:

1. After entering regedit in the Cortana search bar, press Enter to enter the Registry Editor

2. Navigate to

HKEY_CLASSES_ROOT\\Microsoft.PowerShellScript.1\\shell

3, create a new item, name it runas, as shown below ——

4, New The string value, named HasLUAShield, the numerical data does not need to be modified, keep empty, as shown below ——

5, create a new item under runas, named command, as shown below ——

6, double-click "(default)", modify its value data as follows:

powershell.exe "-Command" "if((Get-ExecutionPolicy) - Ne 'AllSigned') { Set-ExecutionPolicy -Scope Process Bypass }; & '%1'"

Click on “OK", on any “.ps1” file Right click, you will see the option to "Run as administrator", if you want to restore the default, just delete the above key values. In order to facilitate the addition of this function, IT House has packaged and uploaded the above registry contents, and users who need it can download and use it.

Registration file download: Click here to enter the network disk

Copyright © Windows knowledge All Rights Reserved