$a = get-netadapter -name "ethernet"
$a.MacAddress
how get it alone mac adress from Object to String or Array of String
hello,
somebody among you, Do you know how to get only mac adress in string type?
I do follows commands:
$A = get-netadapter -name "ethernet" | format-list -Property "macaddress"
PS U:\users\SalvatoreGallitano> $a
MacAddress : 1C-1B-0D-9F-00-00
PS U:\users\SalvatoreGallitano> $a.GetType()
IsPublic IsSerial Name BaseType
True True Object[] System.Array
I wold like only mac code in string type but i do not get it.
it say that it is a array with 5 element but i can't access to it.
i tried this:
$a[0] or other numbers but anything.
Windows for business Windows Server User experience PowerShell
-
Justin Iven Müller 76 Reputation points
2022-04-22T13:49:40.897+00:00
1 additional answer
Sort by: Most helpful
-
Salvo Gallitano 21 Reputation points
2022-04-22T13:54:30.647+00:00 right!
Why do not i thing first?!
i tried to do it but i did not delete format-list.Great!
Thanks!