Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
 
 

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

Outline

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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.