Private/Get-FatCachedAdGroupId.ps1
1 2 3 4 5 6 7 8 9 10 11 12 |
Function Get-FatCachedAdGroupId{ param($DisplayName) if ($null -eq $AdGroupCache){ $global:AdGroupCache = @{} } if (-not $global:AdGroupCache.ContainsKey($DisplayName)){ $global:AdGroupCache.$DisplayName = (Get-AzADGroup -DisplayName $DisplayName).Id } return @{Id= $global:AdGroupCache.$DisplayName} } |