Lessons Learned

My drop-site for interesting snippets and tips. If it's useful to you as well, great!

Browse by Tags

Tagged Content List
  • Blog Post: Why Don’t I Use [Parameter(Mandatory=$true)]$ParameterName?

    PowerShell’s Domain Specific Language for describing command-line parameter attributes (see about_Functions_Advanced) offers many features.  It’s powerful, versatile, and allows scripts to implement some of the worst features of true cmdlets. What do I mean (this time)? Halt-and-Demand-User-Input...
  • Blog Post: Tip: Passing [switch]Parameters to Nested Functions

    Here's something that bedeviled me for the longest time: if I have a [switch] type parameter at the script level, how do I pass it to the core function it calls? # script Test-It.ps1 will call Test-It function param   (      [String[]] $ComputerName   =   @( ) ,     ...
Page 1 of 1 (2 items)