The following examples show how data input is bound to the parameters for a defined scriptblock when the parameter isn't defined with a specific type. The data that the resource passes to a script is ...
One source of input for a cmdlet is an object on the pipeline that originates from an upstream cmdlet. This section describes how to add a parameter to the Get-Proc cmdlet (described in Creating Your ...
If you are building PowerShell longer than a few lines, it is good practice to break up your code into reusable snippets. This way you can only call the code snippet over and over instead of ...
I don't want to say "Oops, I ran it with the wrong date..." ever again. So, I created a small script (named checker.ps1) that validates the date, count, and file path ...
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 used ...
If your automated script takes action based on a value, it's critical to make sure the value is correct. Good thing PowerShell has ways to validate the values that are passed to a function. In recent ...
I recently participated in PowerShell Wednesday on the PDQ Discord server, and the topic was pipelines. I prepared a few notes in preparation and I thought it might be a good idea to share them here.
"This application has a 5-digit employee ID."—I used to find these manually every week. So, I created a PowerShell script called checker.ps1 that is just over 30 lines long. It reads a CSV exported ...