Results 1 to 4 of 4
  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts

    When is a healthy disk a not so healthy disk?

    Hey Y'all,

    I've run into another head scratcher.

    It seems that when I run the program on Win 8.1 the Get-Disk cmdlet returns a property type of ScriptProperty for HealthStatus with a value of Healthy. However, when I call The Win 8.1 machine from a Win 10 or Win 7 machine it returns a property type of UInt16 with a Value of 1 and according to MS documentation Healthy = 0, Warning = 1, Unhealthy=2, 5=Unknown.

    Here's the code I use to Decode the possibilities:
    Code:
      $fmtPhyDisk2 = 
         @{Expression={ '{0:N0}' -f $_.Number};
             Label="Drive`n No.";Width=5;Align='Center'},
         @{Expression={$_.Model};Label="`nName";Width=$DNLen},
         @{Expression={$_.SerialNumber.Trim()};
             Label="`nSerial Number";Width=$SNLen;Align='left'},
         @{Expression={
            (&{If ($_.HealthStatus.GetType().Name -eq 'UInt16'){
             (& {Switch ($_.HealthStatus) {
                  0      {"Healthy"}
                  1      {"Warning"}
                  2      {"Unhealthy"}
                 Default {"Unknown"}}})} 
               Else{$_.HealthStatus}})};Label="`nStatus";Width=7},
         @{Expression={$_.Speed};
             Label="Rotation`n  RPMs  ";Width=8;Align='Right'}
    
      $PhyDiskInfo2 = $PhyDiskInfo | 
               Format-Table -Property $fmtPhyDisk2 | Out-String
    Anyone have a clue as to why you get one thing when run local and another when run remotely?

    Here's my testing grid if you're interested:
    TestGrid.PNG

    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

  2. #2
    4 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    561
    Thanks
    51
    Thanked 68 Times in 66 Posts
    When is a healthy disk a not so healthy disk?
    When it's a herniated disk?


    Thank you, I'll see myself to the door!

  3. #3
    Super Moderator BATcher's Avatar
    Join Date
    Feb 2008
    Location
    A cultural area in SW England
    Posts
    3,420
    Thanks
    33
    Thanked 195 Times in 175 Posts
    Have you performed any comparison with the S.M.A.R.T. statistics?
    BATcher

    Time prevents everything happening all at once...

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,436
    Thanks
    372
    Thanked 1,457 Times in 1,326 Posts
    BATcher,

    HD Sentinel pronounces the drive 100% Healthy. The program run locally on the machine does the same. It's only when I run the program from a remote machine that it produces the Warning status.
    May the Forces of good computing be with you!

    RG

    PowerShell & VBA Rule!

    My Systems: Desktop Specs
    Laptop Specs

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •