Created
December 2, 2017 22:47
-
-
Save mczerniawski/42606920821c93ab64fe98c3998e3219 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$StorageJobs = Get-StorageJob | |
foreach ($stJob in $StorageJobs) { | |
foreach ($jobObjectID in ($stJob | Select-Object -ExpandProperty ObjectId)) { | |
$objectID = $jobObjectID | Select-String -Pattern '([A-Za-z0-9]{8}\-?){1}([A-Za-z0-9]{4}){1}' -AllMatches | | |
Select-Object -ExpandProperty Matches | | |
Select-Object -ExpandProperty Value -Last 1 | |
$vdisk = Get-VirtualDisk | Where-Object {$_.ObjectId -match $objectID} | |
[PSCustomObject]@{ | |
VirtualDiskName = $vdisk.FriendlyName | |
HealthStatus = $vdisk.HealthStatus | |
JobState = $stJob.JobState | |
PercentComplete= $stJob.PercentComplete | |
Name = $stJob.Name | |
BytesProcessed = $stJob.BytesProcessed | |
BytesTotal = $stJob.BytesTotal | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment