In powershell you pretty much never want to use Write-Host, its output can't be redirected along the pipeline. You couldn't pipe this output to a logfile.

This commit is contained in:
Jack Bennett 2014-03-05 13:28:18 +00:00
parent 1225d410fa
commit 5243d8bb8d

View File

@ -79,7 +79,7 @@ Push-Location -Path $saveTo
$sources = Get-Content $sourcesPath | Out-String | Convertfrom-Json
foreach ($s in $sources) {
Write-Host "Getting $($s.name) from URL $($s.url)"
Write-Output "Getting $($s.name) from URL $($s.url)"
# We do not care about the extensions/type of archive
$tempArchive = "$($s.name).tmp"
@ -97,4 +97,4 @@ foreach ($s in $sources) {
}
Pop-Location
Write-Host "All good and done!"
Write-Output "All good and done!"