any idea why I am getting this error
get-diskspace2.ps1
param(
[string]$VM
)
$report += Get-WmiObject Win32_Volume -ComputerName $VM| ForEach {
New-Object PSObject -Property @{
Computername = $VM
Name = $.Name
Label = $.Label
FreeSpace_GB = ([Math]::Round($.FreeSpace /1GB,2))
TotalSize_GB = ([Math]::Round($.Capacity /1GB,2))
UsedSpace_GB = ([Math]::Round($.Capacity /1GB,2)) - ([Math]::Round($.FreeSpace /1GB,2))
Percent_Free = ([int]($.Freespace*100/$.Capacity))
filesystem = $_.filesystem
}
}
$report