Information

## 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. … [ Continue reading ]

Configuration

## 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. … [ Continue reading ]

Configuration

## 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

Information

## 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) { "exists" } PS C:\> If ($IntValue1) { "exists" }
exists
PS C:\> if ($StringValue0) { "exists" } exists PS C:\> if ($StringValue1) { "exists" }
exists
PS C:\> if ($IntValue0 -eq$null) { "null" }
PS C:\> if ($IntValue0 -lt 1) {"less than 1" } less than 1 PS C:\>$IntValue0.GetType()

IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True True Int32 System.ValueType