locked
Creating VM with powerShell: New-AzVm : Object reference not set to an instance of an object. RRS feed

  • Question

  • Hello, here is the cmd I use: 

    New-AzVm -ResourceGroupName ShellRG -Name backupvm -Location northeurope -Image win2016datacenter -Credential (Get-Credential)

    Outcome: 

    cmdlet Get-Credential at command pipeline position 1
    Supply values for the following parameters:
    Credential
    New-AzVm : Object reference not set to an instance of an object.
    At line:1 char:1
    + New-AzVm -ResourceGroupName ShellRG -Name backupvm -Location northeur ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : CloseError: (:) [New-AzVM], NullReferenceException
        + FullyQualifiedErrorId : Microsoft.Azure.Commands.Compute.NewAzureVMCommand

    Any idea how to solve this ?  THAnks !

    Monday, October 5, 2020 2:19 PM

All replies