Formatting Bios SerialNumber Script Output in PowerShell
04/05/2017 2149 views
Newbie question new to KACE and Powershell, but I have been searching and reading for a while now and cannot figure out how to format so I only get serial number value from bios.
Using 1st part of script below I get "Serialnumber : 1GXBJL1"
where all I want is the "1GXBJL1" that I can pass to 2nd part.
# Getting the Serial Number from Bios and Outputting to Defined Variable.
gwmi win32_bios | Format-List serialnumber -OutVariable CN
Rename-Computer -NewName "$CN" -Restart
Thanks in advance.