I have to do this quite a lot for my physical HP servers, and previously it was quite a time consuming task. So here is a small script which might make things a little easier.
$servers = Get-Content C:\powershell\Scripts\SerialNumber\servers.txt
The good thing about this is that, its got error handling in place. So if a script cannot find the information of a server, it will display a warning message with the server name, instead of spitting about that ugly red message in powershell by default.