From 434d8c2b9b32bc17fde46024528fdc849444a5fe Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 20 Sep 2017 19:34:38 +0100 Subject: [PATCH 1/3] Created Get-TotalDiskUsage --- Scripts/Get-TotalDiskUsage | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 Scripts/Get-TotalDiskUsage diff --git a/Scripts/Get-TotalDiskUsage b/Scripts/Get-TotalDiskUsage new file mode 100644 index 0000000..b14e7d5 --- /dev/null +++ b/Scripts/Get-TotalDiskUsage @@ -0,0 +1,4 @@ +#Script returns total disk usage by all Powered On VMs in the environment in Gigabytes +#Author: Chris Bradshaw via https://isjw.uk/using-powercli-to-measure-vm-disk-space-usage/ + +[math]::Round(((get-vm | Where-object{$_.PowerState -eq "PoweredOn" }).UsedSpaceGB | measure-Object -Sum).Sum) From da2cf62c1b835f9e46b7f10e4e13c091f6cb303e Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 20 Sep 2017 19:37:36 +0100 Subject: [PATCH 2/3] Create Get-TotalMemoryAllocation.ps1 --- Scripts/Get-TotalMemoryAllocation.ps1 | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 Scripts/Get-TotalMemoryAllocation.ps1 diff --git a/Scripts/Get-TotalMemoryAllocation.ps1 b/Scripts/Get-TotalMemoryAllocation.ps1 new file mode 100644 index 0000000..6e6736d --- /dev/null +++ b/Scripts/Get-TotalMemoryAllocation.ps1 @@ -0,0 +1,6 @@ +#Script gets total memory allocation in GB of all powered on VMs in the environment +#Author: Chris Bradshaw via https://isjw.uk/powercli-snippet-total-memory-allocation/ + +[System.Math]::Round(((get-vm | + where-object{$_.PowerState -eq "PoweredOn" }).MemoryGB | + Measure-Object -Sum).Sum ,0) From 78d606ab44228ce6404a4b4ad247cd102fa5ff11 Mon Sep 17 00:00:00 2001 From: Chris Date: Wed, 20 Sep 2017 19:38:14 +0100 Subject: [PATCH 3/3] Rename Get-TotalDiskUsage to Get-TotalDiskUsage.ps1 --- Scripts/{Get-TotalDiskUsage => Get-TotalDiskUsage.ps1} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Scripts/{Get-TotalDiskUsage => Get-TotalDiskUsage.ps1} (100%) diff --git a/Scripts/Get-TotalDiskUsage b/Scripts/Get-TotalDiskUsage.ps1 similarity index 100% rename from Scripts/Get-TotalDiskUsage rename to Scripts/Get-TotalDiskUsage.ps1