Launch PowerShell with AutoHotkey

Sometimes nerds like me just need to open PowerShell as fast as possible.

This is very easy to achieve thanks to AutoHotkey – a very popular desktop automation application for Windows.

First install AutoHotkey from their website. Modern Windows machines just want the x64 + Unicode option when installing, if in doubt check their help documentation.

Once you’ve got it installed you need to create a new file for the script. For me, I created a new file called PowerShell.ahk in my scripts directory using gvim – but you can use your editor of choice and place it wherever you like.

Inside the file enter the following script:

   Run, PowerShell

The # is the symbol used for the Windows key, the + is the symbol used for shift, and the p stands for PowerShell. On then next line I’ve put Run, PowerShell and that’s it.

This means we are set up to run PowerShell when we press WIN + SHIFT + P.

Obviously you can do a lot more than just this, and for me starting PowerShell like that is not enough – I really dislike that blue background they use by default.

I have already set myself up with a nicely customised shortcut to PowerShell which I keep in my scripts folder and syncronise across machines. This includes the font and colour options I prefer.

   Run, C:\Users\Julian\Scripts\PowerShell.lnk

However you decided to script it, you just need to double click the PowerShell.ahk file when you’re done and AutoHotkey will register the combination for you.

There you have it! A super fast way to bring up a PowerShell prompt whenever you need it.