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

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

Open
andreasjordan opened this issue Nov 7, 2022 · 0 comments
Open

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

andreasjordan opened this issue Nov 7, 2022 · 0 comments
Assignees
Labels

Comments

@andreasjordan
Copy link

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.

@jdhitsolutions jdhitsolutions self-assigned this Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants