Skip to content

Commit

Permalink
removed partialmgdiscovery boolean (#310)
Browse files Browse the repository at this point in the history
  • Loading branch information
daltondhcp authored Apr 20, 2021
1 parent 27e9db7 commit 7349864
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
13 changes: 5 additions & 8 deletions src/functions/Initialize-AzOpsEnvironment.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,6 @@
Subscription filter.
Subscriptions in the listed states will be ignored.
For example, by default, disabled subscriptions will not be processed.
.PARAMETER PartialMgDiscovery
Enable partial management group discovery.
Necessary if current user does not have root access.
Must be used in combination with -PartialMgDiscoveryRoot
.PARAMETER PartialMgDiscoveryRoot
Custom search roots under which to detect management groups.
Used for partial management group discovery.
Expand All @@ -46,9 +42,6 @@
[string[]]
$ExcludedSubState = (Get-PSFConfigValue -FullName 'AzOps.Core.ExcludedSubState'),

[switch]
$PartialMgDiscovery = (Get-PSFConfigValue -FullName 'AzOps.Core.PartialMgDiscoveryRoot'),

[string[]]
$PartialMgDiscoveryRoot = (Get-PSFConfigValue -FullName 'AzOps.Core.PartialMgDiscoveryRoot')
)
Expand Down Expand Up @@ -110,11 +103,15 @@
Write-PSFMessage -String 'Initialize-AzOpsEnvironment.ManagementGroup.NoRootPermissions' -StringValues $currentAzContext.Account.Id
$PartialMgDiscovery = $true
}
else {
$PartialMgDiscovery = $false
}
#endregion Validate root '/' permissions

#region Partial Discovery
if ($PartialMgDiscovery -and $PartialMgDiscoveryRoot) {
if ($PartialMgDiscoveryRoot) {
Write-PSFMessage -Level Warning -String 'Initialize-AzOpsEnvironment.ManagementGroup.PartialDiscovery'
$PartialMgDiscovery = $true
$managementGroups = @()
foreach ($managementRoot in $PartialMgDiscoveryRoot) {
$managementGroups += [pscustomobject]@{ Name = $managementRoot }
Expand Down
6 changes: 0 additions & 6 deletions src/functions/Initialize-AzOpsRepository.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@
Delete all AutoGeneratedTemplateFolderPath folders inside AzOpsState directory.
.PARAMETER Force
Delete $script:AzOpsState directory.
.PARAMETER PartialMgDiscovery
Accept working with only a subset of management groups in the entire hierarchy.
Needed when lacking root access.
.PARAMETER PartialMgDiscoveryRoot
The subset of management groups in the entire hierarchy with which to work.
Needed when lacking root access.
Expand Down Expand Up @@ -65,9 +62,6 @@
[switch]
$Force,

[switch]
$PartialMgDiscovery = (Get-PSFConfigValue -FullName 'AzOps.Core.PartialMgDiscoveryRoot'),

[string[]]
$PartialMgDiscoveryRoot = (Get-PSFConfigValue -FullName 'AzOps.Core.PartialMgDiscoveryRoot'),

Expand Down
1 change: 0 additions & 1 deletion src/internal/configurations/Core.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,5 @@ Set-PSFConfig -Module AzOps -Name Core.SkipResourceGroup -Value $false -Initiali
Set-PSFConfig -Module AzOps -Name Core.SkipRole -Value $false -Initialize -Validation bool -Description '-'
Set-PSFConfig -Module AzOps -Name Core.State -Value (Join-Path $pwd -ChildPath "root") -Initialize -Validation string -Description 'Folder to store AzOpsState artefact'
Set-PSFConfig -Module AzOps -Name Core.SubscriptionsToIncludeResourceGroups -Value @('*') -Initialize -Validation stringarray -Description 'Requires SkipResourceGroup to be false. Subscription ID or Display Name that matches the filter. Powershell filter that matches with like operator is supported.'
Set-PSFConfig -Module AzOps -Name Core.SupportPartialMgDiscovery -Value $false -Initialize -Validation bool -Description 'Enable partial discovery'
Set-PSFConfig -Module AzOps -Name Core.TemplateParameterFileSuffix -Value '.json' -Initialize -Validation string -Description 'parameter file suffix to look for'
Set-PSFConfig -Module AzOps -Name Core.ThrottleLimit -Value 10 -Initialize -Validation integer -Description 'Throttle limit used in Foreach-Object -Parallel for resource/subscription discovery'

0 comments on commit 7349864

Please sign in to comment.