Skip to content

New-AzVm cmdlet fails when resourcegroup is used a second time after bad credentials are entered #4647

@maddieclayton

Description

@maddieclayton

Cmdlet(s)

New-AzVm

PowerShell Version

5.1.15063.608

Module Version

OS Version

10.0.15063.608

Description

When run New-AzVm with a new resource group but enter invalid credentials (password strength too low), and re-run the cmdlet with the same parameters, the cmdlet will fail, saying:

New-AzureRmVM : Cannot validate argument on parameter 'ResourceGroupName'. The argument is null or empty. Provide an
argument that is not null or empty, and then try the command again.
At C:\Program Files\WindowsPowerShell\Modules\AzureRM.Compute.Experiments\1.0.25\AzureRM.Compute.Experiments.psm1:582
char:32
             -ResourceGroupName $rgName `
                                ~~~~~~~
     CategoryInfo          : InvalidData: (:) [New-AzureRmVM], ParameterBindingValidationException
     FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.Compute.NewAzureVMCommand

Debug Output

Script/Steps for Reproduction

New-AzVm -Name maclatyomachine -ResourceGroupName maclaytoregr1
(enter invalid credentials)
New-AzVm -Name maclatyomachine -ResourceGroupName maclaytoregr1

Metadata

Metadata

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions