< Back

Get-ProvAzureVM

Sun Jan 19, 2020 5:38 pm

NAME Get-ProvAzureVM



SYNOPSIS

Retrieves the list of Azure virtual machines.





SYNTAX

Get-ProvAzureVM -AuthContext <object> -SubscriptionId <Guid> [-ApiVersion <string>] [-ExcludeARMVMs

<SwitchParameter>] [-ExcludeClassicVMs <SwitchParameter>] [-SyncOnlyTag <SwitchParameter>] [<CommonParameters>]



Get-ProvAzureVM -AuthContext <object> -Name <string> -SubscriptionId <Guid> [-ApiVersion <string>] [-ExcludeARMVMs

<SwitchParameter>] [-ExcludeClassicVMs <SwitchParameter>] [-SyncOnlyTag <SwitchParameter>] [<CommonParameters>]



Get-ProvAzureVM -AuthContext <object> -ResourceGroup <string> -SubscriptionId <Guid> [-ApiVersion <string>]

[-ExcludeARMVMs <SwitchParameter>] [-ExcludeClassicVMs <SwitchParameter>] [-Name <string>] [-SyncOnlyTag

<SwitchParameter>] [<CommonParameters>]





DESCRIPTION

This commandlet retrieves all virtual machines from Azure subscription.



The output can be limited by filtering either by name of virtual machine (the Id), or by resource group.





PARAMETERS

-AuthContext <object>

The authorization context obtain with "Get-ProvAzureAuthContext".



Store the output of this command in a variable and use it as input value for this parameter"



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-SubscriptionId <Guid>

The GUID of the Azure Subscription where the virtual machines have been created.



Required? true

Position? named

Default value 00000000-0000-0000-0000-000000000000

Accept pipeline input? false

Accept wildcard characters? false



-ApiVersion <string>

The version of the API to use.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Name <string>

The name of the Virtual Machine to look for.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ResourceGroup <string>

The name of the resource group contains the virtual machine.



Required? true

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ExcludeClassicVMs <SwitchParameter>



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-ExcludeARMVMs <SwitchParameter>



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-SyncOnlyTag <SwitchParameter>



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

Provance.Azure.Common.Model.VirtualMachine





---------- EXAMPLE 1 ----------



Retrieve all virtual machines from subscription





$vm = Get-ProvAzureVirtualMachine -AuthContext $token -SubscriptionID '90419738-1ef5-4c31-a142-0dc9603958e2'



The $token object shall be generated with Get-ProvAzureAuthContext first



---------- EXAMPLE 2 ----------



Retrieve virtual machines from the resource group





$vm = Get-ProvAzureVirtualMachine -AuthContext $token -SubscriptionID '90419738-1ef5-4c31-a142-0dc9603958e2'

-ResourceGroupName 'VirtualMachines'



The $token object shall be generated with Get-ProvAzureAuthContext first



---------- EXAMPLE 3 ----------



Retrieve virtual machine by name





$vm = Get-ProvAzureVirtualMachine -AuthContext $token -SubscriptionID '90419738-1ef5-4c31-a142-0dc9603958e2'

-ResourceGroupName 'VirtualMachines'



The $token object shall be generated with Get-ProvAzureAuthContext first





RELATED LINKS