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
Post a Comment