News
Posey's Tips & Tricks. How To Validate Input in PowerShell Functions, Part 1. If your automated script takes action based on a value, it's critical to make sure the value is correct.
Basic PowerShell functions. Basic PowerShell functions are straightforward and lack advanced features. They are declared using the function keyword, followed by a set of curly braces: function ...
This is because these functions are not loaded in the same session scope as my DoStuff.ps1 script. Let's remedy that. To make these functions available in the same scope as my calling script, I can ...
You can see that it outputs an object type of Microsoft.PowerShell.Commands.MatchInfo. Let's build a test for this. It's best practice to include your tests with your code. Perhaps I'm dot sourcing my ...
In Part 1 of this series, I showed you an example of PowerShell's native validation capabilities.. In that installment, I wrote a function that accepted a text string as input. The function then ...
Results that may be inaccessible to you are currently showing.
Hide inaccessible results