I have the following xml element:
type = bytes
#text = ABVdZBRW
I’ve been trying to convert the #text value to a MAC address, without much success. The closest I got was:
$mac = "ABVdZBRW" $bytes = [System.Text.Encoding]::UTF8.GetBytes[$mac] [System.BitConverter]::ToString[$bytes] 41-42-56-64-5A-42-52-57
which is obviously wrong!
The value should convert to 00-15-5D-64-14-56… If it helps - the element is from a Legacy Network Adapter section in a Hyper-V virtual machine config file!