Created
January 3, 2023 00:51
-
-
Save Delivator/1a1661c2dbbc28225311f55bd0f3f388 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Param( | |
[Parameter(Mandatory=$True)] | |
[string]$Original, | |
[Parameter(Mandatory=$True)] | |
[string]$Compare | |
) | |
$OriginalSize = (Get-ChildItem $Original | Measure-Object Length -Sum).sum / 1Gb | |
$CompareSize = (Get-ChildItem $Compare | Measure-Object Length -Sum).sum / 1Gb | |
[string]$Difference | |
if ($OriginalSize -lt $CompareSize) { | |
$Percent = [math]::Round(((($OriginalSize / $CompareSize)-1)*-100),2) | |
$Difference = "$Percent% Larger" | |
} else { | |
$Percent = [math]::Round(((($CompareSize / $OriginalSize)-1)*-100),2) | |
$Difference = "$Percent% Smaller" | |
} | |
Write-Host "Before:"("{0:N2} GB" -f ($OriginalSize)) | |
Write-Host "After:"("{0:N2} GB ($Difference)" -f ($CompareSize)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment