O'Reilly logo

Windows PowerShell™ 3.0 Step by Step by Ed Wilson

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

General script readability

The following are points to keep in mind to promote the readability of your script:

  • When creating an alias, include the -description parameter, and use it when searching for your personal aliases. An example of this is shown here (a better approach is to load the aliases from a private module. This way, the modulepath parameter also loads).

    Get-Alias |
    where-object { $_.description -match 'mred' } |
    Format-Table -Property "   ",name, definition -autosize '
                 -hideTableHeaders
  • Scripts should provide help. Use comment-based help to do this.

  • All procedures should begin with a brief comment describing what they do. This description should not describe the implementation details (how the procedure works) because these often ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required