How to use power shell to exctract values from command output


hello,
i'm trying adaptec raid array status using arcconf cli and  powershell monitoring
can not figure out way last values command returned string in power shell.

ps c:\adaptec\msm\cmdline> .\arcconf.exe  getconfig  1  | select-string   -pattern "defunct disk drive count"     defunct disk drive count                 : 0



i need the  "0" value  command output.


please help.

 

try this:

(.\arcconf.exe getconfig 1 | select-string -pattern "defunct disk drive count").tostring().split(":")[1] 



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

Round Robin is killing performance on our network

WMI Repository 4GB limit - Win 2003 Ent Question

Change home folder default permission?