Add PowerShell *.ps1 file to New Context Menu of File Explorer

In this article, I’ll show you ho to get a useful context menu item to create a New -> Windows PowerShell script. It will save you time if you need to create them from time to time. You get a new file with the PS1 extension instantly with one click.

Open the registry editor and go to the following Registry key:

Create a new sub-key named “ShellNew“.

Under the ShellNew subkey, create a new string value named NullFile. Don’t set its value data, leave it empty. This value indicates that Windows should create an empty file without any content.

Now, open the context menu of any folder. You can just right click the empty space on your Desktop. It will have a new item in the “New” context menu:

The next time you need to create a PowerShell script file, you can use this context menu item.

With the Registry File below, you can do the same a described above.

Save it to New PS1 File.reg and double click it to import it into the registry.

I really like to hear what you have to say about this article:

  • Was this article helpful for you or do you have any questions?
  • Do you have additions, suggestions or any other ideas?
  • Just let me know by leaving a comment below.

Thank you for spending some time at my site and in my blog. I hope you come to visit again soon 😉

About Lex van der Horst 201 Articles
Techwire

1 Comment

  1. Hi Lex,
    Firstly, Awesome content.
    Quick Question, is there a simple way to change the instructions/reg entries so that When I select “New Windows PowerShell Script” from the context menu it will create a file based on a specific file or Powershell template I use for consistency?

    Thanks
    Mark

Leave a Reply