Win10 right-click menu to add a new method of PowerShell script

  

Generally speaking, users can create a script file with the extension .ps1 directly through PowerShell ISE, or write the code through a common tool such as Notepad, and then create the extension. But these methods are a bit of a hassle, it is better to create them directly. To add a new item to the right-click menu of the PowerShell script, you only need to add a registry value, which is relatively easy to operate.
The details are as follows:
1, enter regedit in the Cortana search bar, press Enter to enter the registry editor
2, locate to
HKEY_CLASSES_ROOT.ps1
3, create a new item ShellNew

4, NullFile new string value, the data value is left blank, indicating that the new project file is empty, as shown below & mdash; & mdash;


5, file Explorer or directly on the desktop right click the new project should have & ldquo; Windows PowerShell script & rdquo;


modified with immediate effect, if the first one did not brush out, several times more should come out. Double-click the newly created script file and open it with Notepad by default. Of course you can also use PowerShell ISE to edit, it might be better to use some, but the startup is a bit slow.

With the simple operation of the above steps, we can successfully add a new item to the PowerShell script in the Win10 right-click menu.

Copyright © Windows knowledge All Rights Reserved