Results 1 to 4 of 4
  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,492
    Thanks
    377
    Thanked 1,473 Times in 1,340 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
    587
    Thanks
    60
    Thanked 72 Times in 70 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,438
    Thanks
    33
    Thanked 196 Times in 176 Posts
    Have you performed any comparison with the S.M.A.R.T. statistics?
    BATcher

    "The trouble with quotes on the internet is that you can never know if they are genuine."
    Abraham Lincoln
    

  4. #4
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,492
    Thanks
    377
    Thanked 1,473 Times in 1,340 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
  •