Author Posts

July 7, 2016 at 7:12 am

Dear Community
I have the below out put as a text file, how do I convert them in to powershell object with key value pair or convert them in to csv. I am only looking for Bay Server Name Serial Number Status Power UID Partner values.

I am struggling with this . Any help would be appreciated. Thanks 🙂

HP BladeSystem Onboard Administrator
(C) Copyright 2006-2012 Hewlett-Packard Development Company, L.P.

server name [SCRIPT MODE]> show server names

Bay Server Name Serial Number Status Power UID Partner
— —————————– ————— ——– ——- — ——-
1 [Absent]
2 Servernam1 SGH106XV7E OK On Off
3 Servernam1 SGH106XV7H OK On Off
4 Servernam1 TWT752000H OK Off Off
5 [Absent]
6 Servernam1 QS75MZ4620 OK On Off
7 [Absent]
8 [Absent]
9 [Absent]
10 [Subsumed]
11 [Subsumed]
12 [Subsumed]
13 [Absent]
14 [Absent]
15 [Absent]
16 [Absent]
Totals: 4 server blades installed, 3 powered on.

servername-m [SCRIPT MODE]>

July 7, 2016 at 12:52 pm

Import-Csv \\path\to\blades.txt -Delimiter ' ' -Header Bay,ServerName,
SerialNumber,Status,Power,UID,Partner | Select-Object -Skip 7 | 
Export-Csv \\path\to\blades.csv -NoTypeInformation

July 7, 2016 at 2:48 pm

Thank you random command line 😊. Will give it a try and let u know ..