Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants