From 8953a512fe58fd69f54e963364e49b3b89d5f602 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 20 Dec 2018 10:28:31 +0000 Subject: [PATCH] Create Get-Migrations.ps1 Quick function for listing the currently running and recently finished VM migrations --- Scripts/Get-Migrations.ps1 | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 Scripts/Get-Migrations.ps1 diff --git a/Scripts/Get-Migrations.ps1 b/Scripts/Get-Migrations.ps1 new file mode 100644 index 0000000..8336de7 --- /dev/null +++ b/Scripts/Get-Migrations.ps1 @@ -0,0 +1,12 @@ +<# +Script name: get-migrations.ps1 +Created on: 20/12/2018 +Author: Chris Bradshaw @aldershotchris +Description: The purpose of the script is to list the currently running + recently finished VM migrations. +Dependencies: None known +#> +Function Get-Migrations{ + Get-Task | + Where-Object{$_.Name -eq "RelocateVM_Task"} | + Select-Object @{Name="VM";Expression={Get-VM -Id $_.ObjectID}}, State, @{Name="% Complete";Expression={$_.PercentComplete}},StartTime +}