News

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 ...
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 ...
Unleashing PowerShell. Working with strings is certainly a necessary function when developing scripts and executing administrative tasks, but let’s take a look at some more useful ways to put ...
When creating functions, follow a consistent naming pattern, such as starting with a verb (e.g., Get, Set, Start) and using nouns to describe what the function does (Get-UserList). PowerShell ...
A great example of this is using Get-Process and taking one (or more) objects that are outputted and send that into Stop-Process to end the processes. Get-Process -Name powershell | Stop-Process ...
This cmdlet uses a scriptblock for a filter. If the status property of the service is equal to "running," PowerShell sends it on to the pipeline. Otherwise it is discarded. When used in Where-Object, ...
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.