Modules/Core/ARIGetSubs.psm1
function Get-ARISubscriptions { Param ($TenantID) Write-Host "Extracting Subscriptions from Tenant $TenantID" $Subscriptions = Get-AzSubscription -WarningAction SilentlyContinue -InformationAction SilentlyContinue $Subscriptions = $Subscriptions | Where-Object { $_.tenantID -eq $TenantID } if ($SubscriptionID) { if($SubscriptionID.count -gt 1) { $Subscriptions = $Subscriptions | Where-Object { $_.ID -in $SubscriptionID } } else { $Subscriptions = $Subscriptions | Where-Object { $_.ID -eq $SubscriptionID } } } return $Subscriptions } |