Param($LogFile) if ((Get-Service -Name ClusSvc -ErrorAction SilentlyContinue).Status -ne "Running") { return 0 exit } $unhealtydrives = 0 $drives = (Get-StorageSubsystem -FriendlyName "Cluster*"| Get-PhysicalDisk) $outstr ="DeviceId, HealthStatus, Size, AllocatedSize, PhysicalLocation, Node`n" foreach ($drive in $drives) { $node = $drive|Get-StorageNode -PhysicallyConnected if ($node -ne $null) { $node = $node.Name } else { $node = "unknown" } if ($drive.HealthStatus -ne "Healthy") { $unhealtydrives += 1 } $outstr += $drive.DeviceId + ", " + $drive.HealthStatus + ", " + $drive.Size + ", " + $drive.AllocatedSize + ", " + $drive.PhysicalLocation + ", " + $node + "`n" } if($LogFile -ne $null) { if (Test-Path "$LogFile.old") { Remove-Item "$LogFile.old" } if (Test-Path "$LogFile") { Copy-Item $LogFile "$LogFile.old" } $outstr 2>&1 | Out-File -Encoding default $LogFile } else { #Write-Host $outstr } return $unhealtydrives