Silencing the output from 7z so I can actually see what else the script is

doing.
Adding some clearer dubugging info for cleaning up folders
This commit is contained in:
Jack Bennett 2014-03-05 14:00:35 +00:00
parent 5243d8bb8d
commit a9bfd2d2a2

View File

@ -56,8 +56,13 @@ function Ensure-Executable ($command) {
} }
function Delete-Existing ($path) { function Delete-Existing ($path) {
Write-Verbose "Remove $path" Write-Verbose "Removing $path in $(get-location)"
Remove-Item -Recurse -force $path -ErrorAction SilentlyContinue Remove-Item -Recurse -force $path -ErrorAction SilentlyContinue
if(test-path $path -IsValid){
Write-Verbose " Removed: $true"
} else {
Write-Verbose " Removed: $false"
}
} }
# Check for archives that were not extracted correctly # Check for archives that were not extracted correctly
@ -87,7 +92,7 @@ foreach ($s in $sources) {
Delete-Existing $s.name Delete-Existing $s.name
Invoke-WebRequest -Uri $s.url -OutFile $tempArchive -ErrorAction Stop Invoke-WebRequest -Uri $s.url -OutFile $tempArchive -ErrorAction Stop
Invoke-Expression "7z x -y -o$($s.name) $tempArchive" Invoke-Expression "7z x -y -o$($s.name) $tempArchive > `$null"
Remove-Item $tempArchive Remove-Item $tempArchive
if ((Get-Childitem $s.name).Count -eq 1) { if ((Get-Childitem $s.name).Count -eq 1) {