PowerShell is an advanced form of command prompt. It is extended with a huge set of ready-to-use cmdlets and comes with the ability to use .NET framework in various scenarios. When you double-click on a *.ps1 script file, it opens in Notepad or other app associated with this file type. Sometimes it can be very useful to create a shortcut to run your PS1 script file directly.
PowerShell Script from Shortcut
Create for example as .PS1 file
To create a shortcut for a .PS1 PowerShell file , follow the next steps:
Copy the full path to your PS1 script file.
Right click the empty space on your Desktop. Select New > Shortcut from the context menu.
In the shortcut target box, type the following:
powershell.exe -noexit -ExecutionPolicy Bypass -File C:\Users\lex\Desktop\techwire.ps1
Give your shortcut some meaningful name. Click Finish.
Double-click on the shortcut you created to run your script.
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 😉