Skip to content

Commit 8be95cd

Browse files
authored
Update breaking-changes-messages-help.md (#19029)
1 parent 53d934e commit 8be95cd

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

documentation/breaking-changes/breaking-changes-attribute-help.md

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,26 @@ All of the attributes have the following common traits:
3636
The properties "deprecatedByVersion" and "changeInEffectByDate" are information only (for the end user) as of now.
3737

3838
#### Suppress the breaking change messages at runtime
39-
- If the user desires to not see the warning messages generated by the attributes at runtime, they can set the env variable "SuppressAzurePowerShellBreakingChangeWarnings" to "true".
39+
40+
If the user desires to not see the warning messages generated by the attributes at runtime, they can update the `DisplayBreakingChangeWarning` config as below:
41+
42+
```powershell
43+
Update-AzConfig -DisplayBreakingChangeWarning $false
44+
```
45+
46+
This config can be applied to a certain module or cmdlet, allowing the user to suppress breaking change messages just for the chosen part:
47+
48+
```powershell
49+
Update-AzConfig -DisplayBreakingChangeWarning $false -AppliesTo Az.KeyVault
50+
```
51+
52+
For more info, run `Get-Help Update-AzConfig`.
53+
54+
Alternatively, set the env variable "SuppressAzurePowerShellBreakingChangeWarnings" to "true" to suppress all the breaking change messages.
55+
56+
```powershell
57+
Set-Item Env:\SuppressAzurePowerShellBreakingChangeWarnings "true"
58+
```
4059

4160
NOTE :
4261
- The only time you will see the output (at runtime) of an attribute applied to a parameter (property or field) is if the parameter is actually invoked on the cmdline. The breaking change attributes to all parameters that are not invoked are ignored.

documentation/breaking-changes/breaking-changes-messages-help.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Breaking change warnings are a means for the cmdlet authors to communicate with
66

77
## How do I get rid of the warnings?
88

9-
To suppress these warning messages, set the environment variable 'SuppressAzurePowerShellBreakingChangeWarnings' to 'true'.
9+
To suppress these warning messages, set the config 'DisplayBreakingChangeWarning' to '$false'.
1010

11-
```
12-
Set-Item Env:\SuppressAzurePowerShellBreakingChangeWarnings "true"
11+
```powershell
12+
Update-AzConfig -DisplayBreakingChangeWarning $false
1313
```
1414

15-
More details on breaking change message suppression can be found [here](https://github.com/Azure/azure-powershell/blob/preview/documentation/breaking-changes/breaking-changes-attribute-help.md#suppress-the-breaking-change-messages-at-runtime).
15+
More details on breaking change message suppression can be found [here](https://github.com/Azure/azure-powershell/blob/main/documentation/breaking-changes/breaking-changes-attribute-help.md#suppress-the-breaking-change-messages-at-runtime).
1616

1717
## Further reading
1818

0 commit comments

Comments
 (0)