I am new to powershell and still leaning the basics but I've got caught out doing something really simple. What I'm trying to do is export the BIOS properties of a number of servers in a text file, and export them to excel for reporting purposes, but for some reason my head can't work it out!
I've gotten so far at the moment, but this currently doesn't work:
I've gotten so far at the moment, but this currently doesn't work:
Code:
$array = (Get-Content c:\servers.txt)
$array | ForEach-Object {
Get-Wmiobject -ComputerName $_ win32_bios | Select-Object -Property PSComputerName, name, serialnumber, SMBIOSMajorVersion, SMBIOSMinorVersion
}
Export-csv -path C:\export.csv -Append
Last edited: