Skip to content

*AzureVM cmdlets in ResourceManager should have an "Id" parameter #369

@trondhindenes

Description

@trondhindenes

In the current version, in order to stop an azure V2 vm (in resource manager mode), the "ResourceGroup" parameter is required. These cmdlets should support the "id" parameter in order to not have to grab the resourcegroup from the objects returned from get-azurevm.

Currently, in order to stop all V2 vms:
$vms = Get-azurevm
foreach ($vm in $vms)
{
$res = Get-AzureResource -ResourceId $vm.Id
Stop-AzureVM -ResourceGroupName $res.ResourceGroupName -Name $vm.Name -Force
}

Should be:
Get-azureVM | stop-azurevm
or
$vm = get-azurevm
Stop-AzureVM -id $vm.id

Metadata

Metadata

Assignees

No one assigned

    Labels

    ComputeService AttentionThis issue is responsible by Azure service team.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions