Skip to content

Latest commit

 

History

History

TOOL-Clean-MacAddress

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Clean-MacAddress

This function is used to clean up a Mac Address string.

I'm using this for some report and for SCCM Automation to keep everything clean :-)

Loading the function

# Load the function in your PS
. .\Clean-MacAddress.ps1

alt text

Clean a Mac Address

# Clean a Mac Address
Clean-MacAddress -MacAddress '00:11:22:33:44:55'
001122334455

# Clean a Mac Address and convert to UpperCase
Clean-MacAddress -MacAddress '00:11:22:dD:ee:FF' -Uppercase
001122DDEEFF

# Clean a Mac Address and convert to LowerCase
Clean-MacAddress -MacAddress '00:11:22:dD:ee:FF' -Lowercase
001122ddeeff

# Clean a Mac Address and convert to LowerCase and add a dash separator
Clean-MacAddress -MacAddress '00:11:22:dD:ee:FF' -Lowercase -Separator '-'
00-11-22-dd-ee-ff

# Clean a Mac Address and convert to LowerCase and add a dot separator
Clean-MacAddress -MacAddress '00:11:22:dD:ee:FF' -Lowercase -Separator '.'
00.11.22.dd.ee.ff

# Clean a Mac Address and convert to LowerCase and add a colon separator
Clean-MacAddress -MacAddress '00:11:22:dD:ee:FF' -Lowercase -Separator :
00:11:22:dd:ee:ff