Indentation

Indentation is not necessary when you are writing PowerShell code, but it makes the code more readable and understandable. Every code line that is on the same indentation level will be executed in the same context. Additional or subverting code blocks (for example, in if...else statements) are indented. You can do the indentation with either spaces or tab keys, and the choice between these two is a subjective decision. Working with Visual Studio Code, you will not need to manually indent your code anymore.

Try to use the following hotkey for the upcoming examples, to test the automatic indentation function: Shift + Alt+ F.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset