Loading compare.ps1 +10 −5 Original line number Diff line number Diff line Loading @@ -4,25 +4,30 @@ param( [Parameter(Position=1, Mandatory=$true)] [string] $source) $reference = (Get-Item $reference) $source = (Get-Item $source) Write-Host $reference $source $kinds = Get-ChildItem -Directory $reference $ui = (Get-Host).UI.RawUI foreach ($kind in $kinds) { $ui.ForegroundColor = 'White' Write-Host "Checking ${kind.Name}:" Write-Host "Checking $($kind.Name):" $tests = Get-ChildItem -File $kind foreach ($test in $tests) { $other = "$source\${kind.Name}\${other.Name}" $other = Get-Item (Join-Path $source $kind.Name $test.Name) $hashRef = (Get-FileHash -Path $test -Algorithm SHA256).Hash $hashSrc = (Get-FileHash -Path $other -Algorithm SHA256).Hash if ($hashRef -eq $hashSrc) { $ui.ForegroundColor = 'Green' Write-Host " OK $test == $other" $name = $test.Name Write-Host " OK $name" } else { $ui.ForegroundColor = 'Red' Write-Host " NOK $test != $other" Write-Host " $hashRef != $hashSrc" $name = $test.Name Write-Host " NOK $name" } } } $ui.ForegroundColor = 'White' Loading
compare.ps1 +10 −5 Original line number Diff line number Diff line Loading @@ -4,25 +4,30 @@ param( [Parameter(Position=1, Mandatory=$true)] [string] $source) $reference = (Get-Item $reference) $source = (Get-Item $source) Write-Host $reference $source $kinds = Get-ChildItem -Directory $reference $ui = (Get-Host).UI.RawUI foreach ($kind in $kinds) { $ui.ForegroundColor = 'White' Write-Host "Checking ${kind.Name}:" Write-Host "Checking $($kind.Name):" $tests = Get-ChildItem -File $kind foreach ($test in $tests) { $other = "$source\${kind.Name}\${other.Name}" $other = Get-Item (Join-Path $source $kind.Name $test.Name) $hashRef = (Get-FileHash -Path $test -Algorithm SHA256).Hash $hashSrc = (Get-FileHash -Path $other -Algorithm SHA256).Hash if ($hashRef -eq $hashSrc) { $ui.ForegroundColor = 'Green' Write-Host " OK $test == $other" $name = $test.Name Write-Host " OK $name" } else { $ui.ForegroundColor = 'Red' Write-Host " NOK $test != $other" Write-Host " $hashRef != $hashSrc" $name = $test.Name Write-Host " NOK $name" } } } $ui.ForegroundColor = 'White'