Domenic DiPasquale
asked on
Powershell: Obtain serial number from device, output filtering.
I'm working on a PS script that will allow me to obtain the serial number from our workstations (Dell service tag for example.) and store it in a variable. I can obtain this by running the command: Get-WmiObject win32_SystemEnclosure | select serialnumber
I get the following results (X being the Dell Service Tag):
serialnumber
------------
XXXXXXX
I would like to remove the first two lines (serialnumber and ----------------) from the output and have only the service tag display. From there, when I request the string stored in the variable, it will only show the service tag.
PS>$test
XXXXXXX
PS>
Any ideas? Thank you for your time.
I get the following results (X being the Dell Service Tag):
serialnumber
------------
XXXXXXX
I would like to remove the first two lines (serialnumber and ----------------) from the output and have only the service tag display. From there, when I request the string stored in the variable, it will only show the service tag.
PS>$test
XXXXXXX
PS>
Any ideas? Thank you for your time.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Easy A footech! Thank you very much.
Open in new window