If you mean the VM name by the STDIN and want to stop all the VMs that the name does not contain the string ABDK
, then you can use the CLI command only like this:
az vm stop --ids $(az vm list --query "[?contains(@.name, 'ABDK')==`false`].id" -o tsv)
Update:
If you run the CLI command in the Windows PowerShell, then you need to change the command like this:
az vm stop --ids $(az vm list --query "[?!contains(@.name, 'ABDK')].id" -o tsv)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…