Basic Coding Techniques

In this chapter, you'll learn about the basics in PowerShell scripting, which are necessary to develop and understand most PowerShell scripts. We recommend using VSCode when working with the examples provided in this and all subsequent chapters. We put forth our argument in its favor in the previous chapter and the examples assume they are run in the editor's console. You can download the code from GitHub to work with the provided examples; you can find them at https://github.com/ddneves/Book_Learn_PowerShell.

Keep in mind that you should put a lot of efforts into training yourself with the content of this chapter, because it is the foundation for upcoming chapters. Some of the topics are simply introduced and will be expanded upon in upcoming chapters, providing the best didactic methods.

In this chapter, we will cover the following topics:

  • Comments
  • Regions
  • Types
  • Pipelines
  • Commands and parameters
  • PSDrives and PSProviders
  • PowerShell's scripting language:
    • Operators 
    • Loops
    • Break and Continue
    • If...ElseIf...Else
    • Switch
..................Content has been hidden....................

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