This commit is contained in:
Zack Meier
2026-04-15 15:42:41 -05:00
parent 74edcc4d9a
commit 03dba08135
146 changed files with 9119 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
$Datastores = Get-Datastore *224*, *225*, *226*
$Folders = @()
ForEach ($Datastore in $Datastores) {
$DatastoreName = $Datastore.Name
$Folders += Get-ChildItem "vmstores:\itdvmvc2.nd.gov@443\Secondary Datacenter\$DatastoreName" | where-object { $_.ItemType -eq "Folder" -and $_.Name -ne '.dvsData' -and $_.Name -ne '.sdd.sf' -and $_.Name -ne '.vSphere-HA' }
}
$result = @()
ForEach ($Folder in $Folders) {
$obj = [PSCustomObject]@{
Datastore = $Folder.PSPath.split('\')[-2];
Folder = $Folder.Name;
SizeGB = [math]::Round(((Get-ChildItem -Path $Folder.FullName) | Measure-Object -Property Length -Sum).Sum / 1GB, 2);
}
$result += $obj
}
$VMs = Get-VM $Folders.Name | Where-Object { $_.ExtensionData.summary.config.ManagedBy.Type -ne "placeholderVm" } -ErrorAction SilentlyContinue | sort-object Name
Compare-Object $Folders.Name $VMs.Name | sort-object InputObject
F