How to add a PowerShell script to the right-click menu for Win10

  
PowerShell is a tool in Win10. This tool can easily realize various Windows deep operations and won the favor of all the great gods. However, some users have reported that it is better to be able to create a new PowerShell script file directly, but Windows 10 does not provide a ready-made one-click service, you need to do it yourself. But today I'm going to introduce a simpler way to make your system join the PowerShell script right-click to create a new project once and for all, just as easily as creating a new text document.

Generally speaking, users can create script files with the extension .ps1 directly through PowerShell ISE. They can also write code through common tools such as Notepad, and then create extensions by changing the extension. But these methods are a bit of a hassle, it is better to create them directly. Want to add a new item to the right-click menu PowerShell script, just add a registry value, the operation is relatively easy, the specific steps are as follows:
1, enter regedit in the Cortana search bar, press Enter to enter the registry editor
2, positioning (this time is short? Short and short benefits ~)
HKEY_CLASSES_ROOT.ps1
3, new item ShellNew

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


5, in file Explorer or right-click directly on the desktop, 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.


Copyright © Windows knowledge All Rights Reserved