I'm trying to match a string in PowerShell, but I can't get True.
"one.two" -match "One Two"
False
Ok, maybe I gave too limited information of my problem.
So here is a bit more information. I have this code:
$userRoles = @('User', 'Customer Support');
$adGroups = @('ad.group.user', 'ad.group.customer.admin');
$userRoleToAdGroup = @{};
foreach ($userRole in $userRoles) {
$adGroupsMatch = @($adGroups -match "$userRole")
$userRoleToAdGroup.Add($userRole, $adGroupsMatch)
}
$userRoleToAdGroup
And the output value is empty for "Customer Support".