Cmdlets

Choose a cmdlet from the list on the left or search for a specific cmdlet. Choose a cmdlet from the list or search for a specific cmdlet.
About Help  Providers
 

Remove-WAPackVMRole

Remove-WAPackVMRole

microsoft.windowsazure.commands.dll

Synopsis

Removes virtual machine role objects.

Syntax

Remove-WAPackVMRole [-VMRole] [-PassThru] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]

Detailed Description

The Remove-WAPackVMRole cmdlet removes virtual machine role objects.

Parameters

-Force <SwitchParameter>

Indicates that the cmdlet removes a virtual machine without prompting you for confirmation.

Aliases

None

Required?

false

Position

3

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-PassThru <SwitchParameter>

Indicates that the cmdlet returns a Boolean value. If the operation succeeds, the cmdlet returns a value of $True. Otherwise, it returns a value of $False. By default, this cmdlet does not generate any output.

Aliases

None

Required?

false

Position

2

Default value

Accept pipeline input?

false

Accept wildcard characters?

false

-VMRole <VMRole>

Specifies a virtual machine role. To obtain a virtual machine role, use the Get-WAPackVMRole cmdlet.

Aliases

None

Required?

true

Position

1

Default value

Accept pipeline input?

True (ByValue)

Accept wildcard characters?

false

-Confirm <SwitchParameter>

Prompts you for confirmation before running the cmdlet.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

-WhatIf <SwitchParameter>

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Aliases

None

Required?

false

Position

named

Default value

false

Accept pipeline input?

false

Accept wildcard characters?

false

Input Type


Return Type


Notes

None

Examples

Example 1: Remove a virtual machine role (which was created using the WAP portal)

The first command gets the virtual machine role named ContosoVMRole01 by using the Get-WAPackVMRole cmdlet, and then stores that object in the $VMRole variable.

The second command removes the virtual machine role stored in $VMRole. The command prompts you for confirmation.

Assuming this virtual machine role was created using the WAP portal, there’s no need to specify the cloud service name.

PS C:\>$VMRole = Get-WAPackVMRole -Name “ContosoVMRole01”
          PS C:\>Remove-WAPackVMRole -VMRole $VMRole
        

Example 2: Remove a virtual machine role which was created after manually creating a cloud service

The first command gets the virtual machine role named "ContosoVMRole02" by using the Get-WAPackVMRole cmdlet, and then stores that object in the $VMRole variable.

The second command removes the virtual machine role stored in $VMRole. The command prompts you for confirmation.

Assuming this virtual machine role was not created using the portal, the user needs to specify the cloud service name. In this case named "ContosoCloudService02".

PS C:\>$VMRole = Get-WAPackVMRole -Name “ContosoVMRole02”
          PS C:\>Remove-WAPackVMRole -VMRole $VMRole –CloudServiceName “ContosoCloudService02”
        

Example 3: Remove a virtual machine role without confirmation

The first command gets the cloud service named ContosoVMRole03 by using the Get-WAPackVMRole cmdlet, and then stores that object in the $VMRole variable.

The second command removes the virtual machine role stored in $VMRole. This command includes the Force parameter. The command does not prompt you for confirmation.

          PS C:\>$VMRole = Get-WAPackVMRole -Name "ContosoVMRole03"
          PS C:\>Remove-WAPackVMRole -VMRole $VMRole -Force
        

Get-WAPackVMRole
New-WAPackVMRole
Set-WAPackVMRole