You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Pull Request
## Description
Simplify confirmation prompt
## License
By submitting this pull request, I confirm that my contribution is made
under the terms of the projects associated license.
$warningMessage="ALL THE MANAGEMENT GROUP STRUCTURES ONE LEVEL BELOW THE LISTED MANAGEMENT GROUPS WILL BE PERMANENTLY DELETED"
978
-
$confirmationText="I CONFIRM I UNDERSTAND ALL THE MANAGEMENT GROUP STRUCTURES ONE LEVEL BELOW THE LISTED MANAGEMENT GROUPS WILL BE PERMANENTLY DELETED"
979
-
if($DeleteTargetManagementGroups) {
980
-
$warningMessage="ALL THE LISTED MANAGEMENTS GROUPS AND THEIR CHILDREN WILL BE PERMANENTLY DELETED"
981
-
$confirmationText="I CONFIRM I UNDERSTAND ALL THE MANAGEMENT GROUPS AND THEIR CHILDREN WILL BE PERMANENTLY DELETED"
982
-
}
983
-
$continue=Invoke-PromptForConfirmation`
984
-
-message $warningMessage`
985
-
-initialConfirmationText $confirmationText
986
-
if(-not$continue) {
987
-
Write-ToConsoleLog"Exiting..."
988
-
return
989
+
990
+
if($PlanMode) {
991
+
Write-ToConsoleLog"Skipping confirmation for plan mode"
992
+
} else {
993
+
$warningMessage="ALL THE MANAGEMENT GROUP STRUCTURES ONE LEVEL BELOW THE LISTED MANAGEMENT GROUPS WILL BE PERMANENTLY DELETED"
994
+
if($DeleteTargetManagementGroups) {
995
+
$warningMessage="ALL THE LISTED MANAGEMENTS GROUPS AND THEIR CHILDREN WILL BE PERMANENTLY DELETED"
-Message "ALL RESOURCE GROUPS IN THE LISTED SUBSCRIPTIONS WILL BE PERMANENTLY DELETED UNLESS THEY MATCH RETENTION PATTERNS"`
1209
-
-InitialConfirmationText "I CONFIRM I UNDERSTAND ALL SELECTED RESOURCE GROUPS IN THE NAMED SUBSCRIPTIONS WILL BE PERMANENTLY DELETED"
1210
-
if(-not$continue) {
1211
-
Write-ToConsoleLog"Exiting..."
1212
-
return
1220
+
1221
+
if($PlanMode) {
1222
+
Write-ToConsoleLog"Skipping confirmation for plan mode"
1223
+
} else {
1224
+
$continue=Invoke-PromptForConfirmation-Message "ALL RESOURCE GROUPS IN THE LISTED SUBSCRIPTIONS WILL BE PERMANENTLY DELETED UNLESS THEY MATCH RETENTION PATTERNS"
0 commit comments