Remove-SCVirtualNetwork
Removes a virtual network from a host managed by VMM.
Syntax
Remove-SCVirtualNetwork
[-VirtualNetwork] <VirtualNetwork>
[-JobGroup <Guid>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Remove-SCVirtualNetwork
[-ClusterVirtualNetwork] <ClusterVirtualNetwork>
[-JobGroup <Guid>]
[-RunAsynchronously]
[-PROTipID <Guid>]
[-JobVariable <String>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Remove-SCVirtualNetwork cmdlet removes one or more virtual network objects from Virtual Machine Manager (VMM).
This cmdlet returns the object upon success (with the property MarkedForDeletion set to True) or returns an error message upon failure.
Examples
Example 1: Remove a specific virtual network from a host
PS C:\> $VMHost = Get-SCVMHost -ComputerName "VMHost01.Contoso.com"
PS C:\> $Network = Get-SCVirtualNetwork -VMHost $VMHost -Name "InternalVNet01"
PS C:\> Remove-SCVirtualNetwork -VirtualNetwork $Network -Confirm
The first command gets the host object named VMHost01 and stores the object in the $VMHost variable.
The second command gets the virtual network object named InternalVNet01 configured on VMHost01 and stores the object in the $Network variable.
The last command removes InternalVNet01 from VMHost01, prompting you for confirmation before continuing the action.
Parameters
-ClusterVirtualNetwork
Specifies a cluster virtual network object.
Type: | ClusterVirtualNetwork |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-Confirm
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobGroup
Specifies an identifier for a series of commands that will run as a set just before the final command that includes the same job group identifier runs.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-JobVariable
Specifies that job progress is tracked and stored in the variable named by this parameter.
Type: | String |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-PROTipID
Specifies the ID of the Performance and Resource Optimization tip (PRO tip) that triggered this action. This parameter lets you audit PRO tips.
Type: | Guid |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-RunAsynchronously
Indicates that the job runs asynchronously so that control returns to the command shell immediately.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-VirtualNetwork
Specifies a virtual network object.
Type: | VirtualNetwork |
Position: | 0 |
Default value: | None |
Required: | True |
Accept pipeline input: | True |
Accept wildcard characters: | False |
-WhatIf
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |