Skip to content

Instantly share code, notes, and snippets.

@AfroThundr3007730
Created March 25, 2021 20:31
Show Gist options
  • Save AfroThundr3007730/a1cd276d4e609b6c404d5b9b234e4e94 to your computer and use it in GitHub Desktop.
Save AfroThundr3007730/a1cd276d4e609b6c404d5b9b234e4e94 to your computer and use it in GitHub Desktop.
Get a running list of active VITasks
function Get-RunningTasks() {
while ((Get-Task | Where-Object { $_.state -eq 'running' }).count -gt 0) {
Get-Task | Where-Object { $_.state -eq 'running' } |
Sort-Object name, percentcomplete |
Format-Table Name, State, PercentComplete, StartTime,
@{ L = 'Target'; E = { $_.ExtensionData.Info.EntityName } },
@{ L = 'Initiator'; E = { $_.ExtensionData.Info.Reason.UserName } }
Start-Sleep 10
}
}
@AfroThundr3007730
Copy link
Author

Updated version available in my HelperFunctions module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment