Creating a function or script with PowerShell Dynamic Parameters

This week, while contributing code to a collaborative project, I wanted to up my game.  A lot of my tools over the years have used parameters and validation, but one of the more elusive things is creating parameters that have parameter validation criteria set at run-time. Advanced Parameters covers this nicely, including our friends ValidateSet, ValidatePattern,…

0

Update: AAD Connect Network Test Tool

Update (7/24): I updated this since the last revision, so if you downloaded it prior to 7/24/2018, get the newest version. I began working with the product group on rolling in some of the network connectivity and testing checks available in the AAD Connect Network Test tool into the actual AAD Connect product.  I look…

0

Update: AAD Connect Network Test Tool

I trotted out the trusty WireShark and Fiddler tools today and ran through the latest iteration of AAD Connect setup.  In so doing, I’ve added a few endpoints to the test: $CRL http://ocsp.msocsp.com $RequiredResources adminwebservice-s1-co2.microsoftonline.com $RequiredResourcesEndpoints https://adminwebservice-s1-co2.microsoftonline.com/provisioningwebservice.svc As always, the newest version is available at http://aka.ms/aadnetwork. Goodnight and good luck!

0

Testing a variable with the value of zero

Tonight, while working on my previous script, I ran into an interesting problem when testing the presence of a value. Consider this: PS C:\> [int]$IntValue0 = 0 PS C:\> [int]$IntValue1 = 1 PS C:\> [string]$StringValue0 = “0” PS C:\> [string]$StringValue1 = “1” PS C:\> $IntValue0 0 PS C:\> $IntValue1 1 PS C:\> If ($IntValue0) {…

0

PowerShell Null Routing Function

This week, while troubleshooting a networking problem for a customer, I wanted to limit or block network connectivity to some remote endpoints from a test workstation.  To accomplish this, I created a quick PowerShell function to null route the traffic (send it to an invalid/null next hop). You can copy/paste this and save it as…

0