Archive | Powershell tips RSS for this section

How simple some things can be – Powershell indent

In the past few years, I’ve been using tools to indent my code… Today by accident found out that in Powershell ISE, if you select multiple lines and press tab it’ll indent all selected lines… and of course shift+tab will do the reverse.

Amazing how simple some things can be without any tool… And how I’ve never before thought about trying this and automatically went looking to create my own or find an external solution once I couldn’t find it in any menu.

Quick command to open explorer from the current directory in Powershell

Here is a quick command if you want to open Windows Explorer from the current directory in Powershell:

ii .

(note the space between the ‘i’ and the dot)
ii is powershell’s alias for invoke-item. Adding a dot to that command will open the current directory using the default explorer.

Edit: If you’d like to achieve the same at a command prompt, you can run

explorer .