• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
Think PowerShell

Think PowerShell

PowerShell for IT Pros

  • About
    • Who I Am
    • Why I Blog
    • Privacy Policy
  • Resources
    • More PowerShell Sites
    • Post Series Index
  • Get Help
  • Show Search
Hide Search

General

PowerShell Comments: Give Your Script Context

Aaron Rothstein · February 4, 2016 · Leave a Comment

PowerShell Multi-line Comment example.

PowerShell code tells you how, but the PowerShell comments tell you why. Here are the ways to comment your PowerShell and some accompanying best practices.

Mystery code

Here is a scenario all too familar: You are heads down, writing an awesome script. Since you are writing it you know exactly how it works and why you made the design decisions you did. You are so clever! The code is so obvious that it pretty much explains itself to someone reading it.

Now here’s how reality usually goes: A peer needs to make a change to your script. They wonder what the variable name $m represents. They try to trace flow of your script, constantly having to scan to find the function definition you created. Why did you create a special function for that? Couldn’t that be done with the <insert applicable cmdlet name here> cmdlet? What are the prerequisites for this code to run? Does it require a minimum version level of PowerShell? And the questions go on and on.

Even if you as the author come back to review it months down the road, can you reliably remember the logic you used to design and write it?

[Read more…] about PowerShell Comments: Give Your Script Context

PowerShell Execution Policy Explained

Aaron Rothstein · February 3, 2016 · 7 Comments

 

PowerShell Execution Policy Error

Before you can run a PowerShell script, you will need to check the PowerShell Execution Policy setting and possibly change it. Here’s how.

[Read more…] about PowerShell Execution Policy Explained

Windows PowerShell ISE: Develop Your Scripts

Aaron Rothstein · February 2, 2016 · Leave a Comment

Windows PowerShell ISE splash start.

Windows PowerShell ISE (Integrated Scripting Environment) is a bundled script editor  for PowerShell. Here is why you should use it.

Beyond the PowerShell Prompt

PowerShell is a command line tool at its core. It can be used to its fullest extent from an interactive shell prompt. But beyond ad-hoc work, cmdlet exploration and command one-liners, you should be using a script editor for building more complex PowerShell scripts. Luckily, beginning with PowerShell v2 the Windows PowerShell ISE has been included as a companion PowerShell script development environment. The rest of this post is specifically referencing Windows PowerShell ISE v5 (Windows 10), but a lot of these features are included in earlier versions too.

[Read more…] about Windows PowerShell ISE: Develop Your Scripts

PowerShell: One Shell to Rule Them All

Aaron Rothstein · February 1, 2016 · 2 Comments

Windows PowerShell prompt.

Welcome to the inaugural post for Think PowerShell! In determining where to start, I thought it best to do an extremely high-level overview of PowerShell.

A Brief History of PowerShell

PowerShell is a task automation and configuration management scripting framework built on the .NET Framework. Scripts are written using cmdlets (pronounced command-lets), which are special classes built on .NET for performing specific operations.

[Read more…] about PowerShell: One Shell to Rule Them All

  • « Go to Previous Page
  • Page 1
  • Interim pages omitted …
  • Page 7
  • Page 8
  • Page 9

Primary Sidebar

Aaron

Think PowerShell

Copyright © 2025 · Monochrome Pro on Genesis Framework · WordPress · Log in