How to activate auto indentation in Powershell ISE in windows?

Question:

I am using Powershell ISE to write script in windows 7. While writing scripts I have to maintain indentation manually. I didn’t find a way to auto indent the script.

Is there any way to perform/enable auto indentation in Powershell ISE or do we need to install any plugin for it?

Answer:

Vanilla PowerShell ISE doesn’t support auto indentation, There are lots of 3rd party ISEs that support it.

Closest you will get in Vanilla PowerShell is the ability to indent multiple lines at once.
Put the caret where you want to indent Press Shift + Alt + Arrow Up or Down and it will create a line vertically across your rows of text. Press Tab and it will indent all those lines. This lets you indent whole code blocks and functions.

Source:

How to activate auto indentation in Powershell ISE in windows? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply