Hello,
When this code hits the 'If' comparison and there is no value in $T1 (determined by test-item), regardless of how I compare $T1 (1. $T1 -eq " " 2. $T1 -eq "" 3. $T1 -eq $null), it always skips to the 'Else' section. Why? Also, what do I query to know when my 'IF' test returns a True or False? Thanks in advance.
$OurMasterDCList = (get-content OurMasterDCList.txt)
$2DaysDCs = get-addomaincontroller -filter * | sort name | select -Expandproperty name
$T1 = $OurMasterDCList | ? {$2DaysDCs -notcontains $_} # Removed
if ( $T1 -eq " " )
{
$T1 = "nothing"
}
else
{Thanks for your help! SdeDot