We will use the same script as the previous recipe.
- Assign the object returned by the previous recipe to a variable.
$FileCleanupInfo = (& //path/to/02-Clear-LogFiles.ps1)
- Call the SpaceCleared property and divide it by Administrative Constants.
$FileCleanupInfo.SpaceCleared/1KB
$FileCleanupInfo.SpaceCleared/1MB
$FileCleanupInfo.SpaceCleared/1GB
Notice how the results are not just the numbers divided by powers of 1000.
- To show how much of space got cleared from a 250 GB SSD:
($FileCleanupInfo.SpaceCleared)/(250*1e9)*100
An almost negligible number in our case, but here it is.