don't try to show download % if output is redirected, see lukesampson/psutils#2

This commit is contained in:
Luke Sampson
2013-09-26 18:17:17 +10:00
parent 26852e0a76
commit 147ebd92ec
+6
View File
@@ -46,6 +46,12 @@ function dl_with_cache($app, $version, $url, $to) {
}
function dl_progress($url, $to) {
if([console]::isoutputredirected) {
# can't set cursor position: just do simple download
(new-object net.webclient).downloadfile($url, $to)
return
}
$left = [console]::cursorleft
$top = [console]::cursortop