0
votes

I have some old Azure Powershell scripts that I'm breaking out of mothballs to use again. They seem to work as I remember them, except I'm getting these warnings:

$VirtualMachine = Add-AzureRmVMNetworkInterface -VM $VirtualMachine -Id $nic.Id

WARNING: Add-AzureRmVMNetworkInterface: A property of the output of this cmdlet will change in an upcoming breaking change release. The Name property for a Sku will return Standard_LRS and Premium_LRS

$vm = Set-AzureRmVMBootDiagnostics -VM $VirtualMachine -Disable

WARNING: Set-AzureRmVMBootDiagnostics: A property of the output of this cmdlet will change in an upcoming breaking change release. The StorageAccountType property for a DataDisk will return Standard_LRS and Premium_LRS

I'm not using any of the output in my scripts so the warnings are useless. There's a lot of output in these scripts and I only want to see stuff that really concerns the health of the script and the objects created.

2

2 Answers

2
votes

You can suppress the breaking change warning with the following environment variable:

Set-Item Env:\SuppressAzurePowerShellBreakingChangeWarnings "true"

More information here: https://github.com/Azure/azure-powershell/blob/master/documentation/breaking-changes/breaking-changes-messages-help.md

0
votes

Ideally you can use '-WarningAction 0' parameter in your command to supress warning messages. Hope this helps!