Skip to content

Instantly share code, notes, and snippets.

@mczerniawski
Created December 2, 2017 22:33
Show Gist options
  • Select an option

  • Save mczerniawski/355c812acba6fb1c9498a2a669bd9af5 to your computer and use it in GitHub Desktop.

Select an option

Save mczerniawski/355c812acba6fb1c9498a2a669bd9af5 to your computer and use it in GitHub Desktop.
$StorageJobIDs = Get-StorageJob | Select-Object ObjectID | Select-String -Pattern '([A-Za-z0-9]{8}\-?){1}([A-Za-z0-9]{4}\-?){3}([A-Za-z0-9]{12})' -AllMatches |
Select-Object -ExpandProperty Matches |
Select-Object -ExpandProperty Value -Last 1
foreach ($objectId in $StorageJobIDs) {
Get-VirtualDisk | Where-Object {$_.ObjectId -match $objectID}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment