Skip to content

Commit 5c4857e

Browse files
committed
Fix parsing of MAC addresses in Remove-DHCPReservation
Fix the typo in $Reservation.MACAddress.Replace() to remove colons instead of periods.
1 parent d353264 commit 5c4857e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Microsoft.DHCP.PowerShell.Admin.psm1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1450,7 +1450,7 @@ function Remove-DHCPReservation {
14501450
elseif($Scope.GetType() -eq [DHCPScope] -and !$Server) { $Server = $Scope.Server }
14511451
if(!$IPAddress) { Write-Host "Error: Invalid null entry for IPAddress." -ForeGroundColor Red; return }
14521452
if(!$MACAddress) { Write-Host "Error: Invalid null entry for MACAddress." -ForeGroundColor Red; return }
1453-
else { $MACAddress = $MACAddress.Replace("-","").Replace(".","") }
1453+
else { $MACAddress = $MACAddress.Replace("-","").Replace(":","") }
14541454
}
14551455
$text = $(Invoke-Expression "cmd /c netsh dhcp server \\$Server scope $Scope delete reservedip $IPAddress $MACAddress")
14561456
$result = if($text.GetType() -eq [string]){$text}else{$text[($text.Count-1)]}

0 commit comments

Comments
 (0)