'Powershell - windows hard-disk health status is giving inconsistent results

I am using the below PowerShell script to fetch hard-disk health status of windows machine: Get-PhysicalDisk | Select HealthStatus

Issue: For few of the machines the hard-disk health status is frequently changing from warning to healthy and vice-versa.

I wanted to understand why the same PowerShell script is giving varied results. If anyone has any idea on this would be much appreciated!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source