diff --git a/Scripts/Operations/Export-AzPolicyResources.ps1 b/Scripts/Operations/Export-AzPolicyResources.ps1 index 08b9197c..381edf8d 100644 --- a/Scripts/Operations/Export-AzPolicyResources.ps1 +++ b/Scripts/Operations/Export-AzPolicyResources.ps1 @@ -206,9 +206,10 @@ if ($Mode -ne 'exportFromRawFiles') { foreach ($pacSelector in $globalSettings.pacEnvironmentSelectors) { - $pacEnvironment = $pacEnvironments.$pacSelector + # $pacEnvironment = $pacEnvironments.$pacSelector if ($InputPacSelector -eq $pacSelector -or $InputPacSelector -eq '*') { + $pacEnvironment = Select-PacEnvironment $pacSelector -DefinitionsRootFolder $DefinitionsRootFolder -OutputFolder $OutputFolder -Interactive $Interactive $null = Set-AzCloudTenantSubscription -Cloud $pacEnvironment.cloud -TenantId $pacEnvironment.tenantId -Interactive $Interactive if ($Mode -eq 'psrule' -and $PSRuleIgnoreFullScope -eq $false) { $pacEnvironmentOriginalScope = $pacEnvironment.deploymentRootScope