hi,
i am trying to write a script to get the disk storage available on someone's C: and present it in a popup window.
the code seems to run and execute till the end, giving me the popup, however it is not populating the window with the information intended to be stored in my $space variable.
please advise, thanks!
# Write script to get disk space, and provide the amount of space left in a pop-up window
# Get-PSDrive C | Select-Object Free
Get-PSDrive C | Select-Object Free {
$space | Select-Object Root,
@{Name='Free'; Expression={[math]::Round(($space.Free / 1GB), 2)}}
}
# Write-Host $space
$shell =New-Object -ComObject WScript.Shell
$shell.Popup("You have $space remaining on your C: drive")