Skip to content

Create vmCostInfo.ps1 Cannot validate argument on parameter 'VMName'. The "Get-AzVM -Name $_" #2

@s31t0n

Description

@s31t0n

Hi,
i'm getting the following error.

./Create_vmCostInfo.ps1 MyVmName
C:\Create_vmCostInfo.ps1 : Cannot validate
argument on parameter 'VMName'. The "Get-AzVM -Name $_" validation script for the argument with value "MyVmName" did
not return a result of True. Determine why the validation script failed, and then try the command again.
At line:1 char:25

  • ./Create_vmCostInfo.ps1 MyVmName
  •                     ~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Create_vmCostInfo.ps1], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationError,Create_vmCostInfo.ps1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions