PowerShell: Dynamic Parameters and Parameter Validation

Background on Parameter Validation PowerShell advanced functions allow their creators to specify a fair amount of metadata that describes their parameters. One huge benefit of parameter declarations in PowerShell is that it’s possible to validate input right at the parameter level, before you execute any code in the body of the function. This helps make … Read more PowerShell: Dynamic Parameters and Parameter Validation

PowerShell Quick Tip: Determine STA Threading Mode

Some code in PowerShell requires you to use the Single-Threaded Apartment (STA) threading model. The PowerShell version 2.0 console host uses Multi-Threaded Apartment by default. The PowerShell Integrated Scripting Environment (ISE) uses the STA threading model. If you’re writing code using the WPK module included in the PowerShellPack, you will need to ensure that you … Read more PowerShell Quick Tip: Determine STA Threading Mode