Skip to content

Commit

Permalink
Resolved some packaging and installer issues, fixed space freed messa…
Browse files Browse the repository at this point in the history
…ge when no space is able to be freed
  • Loading branch information
DailenG committed Jul 8, 2024
1 parent e02b1d9 commit 4c53bbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Get-FreeSpace.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,18 @@ foreach ($path in $pathsToDelete)
$freedSize += ($sizeBefore - $sizeAfter)
}

# If we calculate a negative number for some reason, lets just set the space freed to zero
if ($freedSize -lt 0)
{
$freedSize = 0
}

# Convert freed size to human-readable format
$humanReadableFreedSize = Convert-Size -Size $freedSize

# Display popup with freed size
Add-Type -AssemblyName PresentationFramework
[System.Windows.MessageBox]::Show("Freed space: $humanReadableFreedSize", "Space Freed", "OK", "Information")
[System.Windows.MessageBox]::Show("Actual freed space: $humanReadableFreedSize", "Space Freed", "OK", "Information")

Write-Host "Freed space: $humanReadableFreedSize"
Write-Host "Completed."
Expand Down
Binary file modified get-freespace.ps1.psbuild
Binary file not shown.

0 comments on commit 4c53bbd

Please sign in to comment.