Skip to content
This repository was archived by the owner on Nov 15, 2024. It is now read-only.
This repository was archived by the owner on Nov 15, 2024. It is now read-only.

Wipe-Lab -RemoveSwitch only removes NetNat, but not Switch #265

@andreasjordan

Description

@andreasjordan

Not sure if bug or feature, but the code only runs Remove-NetNat and not Remove-VMSwitch:

if ($RemoveSwitch) {
Write-Verbose "Removing the Hyper-V switch"
$removeParams.Add("RemoveSwitch", $True)
# Delete NAT
$NatName = $Labdata.AllNodes.IPNatName
if ($pscmdlet.ShouldProcess("LabNat", "Remove NetNat")) {
Write-Verbose "Remoting NetNat"
Remove-NetNat -Name $NatName
}
}

So I had to also run Remove-VMSwitch -Name $Labdata.AllNodes.Lability_SwitchName.

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions