Skip to content
This repository has been archived by the owner on Jul 6, 2023. It is now read-only.

Commit

Permalink
Fixed a stupid bug with MAC validation
Browse files Browse the repository at this point in the history
  • Loading branch information
BornToBeRoot committed Nov 10, 2016
1 parent a0bec48 commit 25b7ea3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Module/LazyAdmin/Functions/Network/Get-MACVendor.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ function Get-MACVendor
Mandatory=$true,
HelpMessage='MAC-Address or the first 6 digits of it')]
[ValidateScript({
if($EnteredMAC -match "^(([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9A-Fa-f]{2}){6})|([0-9A-Fa-f]{2}[:-]){2}([0-9A-Fa-f]{2})|([0-9A-Fa-f]{2}){3}$")
if($_ -match "^(([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})|([0-9A-Fa-f]{2}){6})|([0-9A-Fa-f]{2}[:-]){2}([0-9A-Fa-f]{2})|([0-9A-Fa-f]{2}){3}$")
{
return $true
}
else
{
throw "Enter a valid MAC-Address (like 00:00:00:00:00:00)!"
throw "Enter a valid MAC-Address (like 00:00:00:00:00:00 or 00-00-00-00-00-00)!"
}
})]
[String[]]$MACAddress
Expand Down

0 comments on commit 25b7ea3

Please sign in to comment.