Results 1 to 4 of 4
  1. #1
    Super Moderator RetiredGeek's Avatar
    Join Date
    Mar 2004
    Location
    Manning, South Carolina
    Posts
    9,781
    Thanks
    403
    Thanked 1,554 Times in 1,407 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
    5 Star Lounger
    Join Date
    Jan 2010
    Location
    Fort McMurray, Alberta, Canada
    Posts
    691
    Thanks
    72
    Thanked 89 Times in 84 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,496
    Thanks
    34
    Thanked 203 Times in 182 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,781
    Thanks
    403
    Thanked 1,554 Times in 1,407 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
  •