Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

want to select disk status string only

$
0
0

I want select disk status about ok, failed, offline and degraded in the script.

I am very new to powershell and just started to learn, have tried select-string and where-object but not able select only disk status string.

Can someone please help me to how achieve this in powershell.

RAID Volumes
============
ID     Name            Device                        Status    Num Disks   Level   Size (GiB)
---------------------------------------------------------------------------------------------
c0r0                   \\.\PhysicalDrive0            DEGRADED  8           5       150
c0r1                   \\.\PhysicalDrive1            DEGRADED  8           5       1799

DISKS In Use
============
ID      Chassis   Slot   RAID ID   Status    Type   Media   Spare      Size (GiB)
---------------------------------------------------------------------------------
c0d0    0         0      c0r0              OK        sas    HDD     -          21
c0d0    0         0      c0r1              OK        sas    HDD     -          257
c0d1    0         1      c0r0              OK        sas    HDD     -          21
c0d1    0         1      c0r1              OK        sas    HDD     -          257
c0d2    0         2      c0r0              OK        sas    HDD     -          21
c0d2    0         2      c0r1              OK        sas    HDD     -          257
c0d3    0         3      c0r0           FAILED    sas    HDD     -          21
c0d3    0         3      c0r1           FAILED    sas    HDD     -          257
c0d4    0         4      c0r0              OK        sas    HDD     -          21
c0d4    0         4      c0r1              OK        sas    HDD     -          257
c0d5    0         5      c0r0              OK        sas    HDD     -          21
c0d5    0         5      c0r1              OK        sas    HDD     -          257
c0d6    0         6      c0r0              OK        sas    HDD     -          21
c0d6    0         6      c0r1              OK        sas    HDD     -          257
c0d7    0         7      c0r0              OK        sas    HDD     -          21
c0d7    0         7      c0r1              OK        sas    HDD     -          257


Viewing all articles
Browse latest Browse all 6937

Trending Articles