I've been googling this for hours and can't find anything that's actually working.
I'm trying to use powershell to report the quota limit/size of a shared drive. My query code is:
$DiskSize = Get-WmiObject Win32_Mappedlogicaldisk -Filter "DeviceID='N:'" | Select Size | Out-String
$FreeSpace = Get-WmiObject Win32_Mappedlogicaldisk -Filter "DeviceID='N:'" | Select FreeSpace
Problem is, $FreeSpace is reporting the physical drive space (2TB~) and not the quota size of 500mb. Our quotas change constantly so giving $disksize a value of 500 won't work as it won't reflect changes made on the server.