Functions/Get-DiskFailurePrediction.ps1

<#
.SYNOPSIS
Shows predicted disk failures
 
.DESCRIPTION
Uses WMI to query SMART Info from Disks and shows failure prediction
 
.EXAMPLE
Get-DiskFailurePrediction
 
Description
-----------
Shows SMART error prediction status of all internal disks
#>

function Get-DiskFailurePrediction {
    [CmdletBinding()]
    [OutputType([String])]
    Param()

    Begin {
        $FailureStatus = Get-CimInstance -namespace "root\wmi" -classname "MSStorageDriver_FailurePredictStatus"
    }

    Process {
        Write-Output -InputObject $FailureStatus
    }

    End {
    }
}