diff --git a/Scripts/download.ps1 b/Scripts/download.ps1 index 647fff0e..988dd787 100755 --- a/Scripts/download.ps1 +++ b/Scripts/download.ps1 @@ -7,13 +7,14 @@ # License: CC0 param([string]$URL) -if ($URL -eq "" ) { - $URL = read-host "Enter URL to download" -} try { + if ($URL -eq "" ) { + $URL = read-host "Enter URL to download" + } + wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose - write-host "✔️ Done." + Write-Output "OK." exit 0 } catch { Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" diff --git a/Scripts/simulate-typewriter.ps1 b/Scripts/simulate-typewriter.ps1 index 3cd36abc..591b356f 100755 --- a/Scripts/simulate-typewriter.ps1 +++ b/Scripts/simulate-typewriter.ps1 @@ -10,14 +10,19 @@ param([string]$message) if ($message -eq "" ) { $message = "`nHello World`n-----------`nPowerShell is cross-platform`nPowerShell is open-source`nPowerShell is easy to learn`nPowerShell is fully documented`n`nThanks for watching`n`n:-)`n`n" } +$speed = 250 -$Speed = 250 -$Random = New-Object System.Random +try { + $Random = New-Object System.Random -$message -split '' | - ForEach-Object { - Write-Host -nonewline $_ - Start-Sleep -milliseconds $(1 + $Random.Next($Speed)) - } + $message -split '' | + ForEach-Object { + Write-Host -nonewline $_ + Start-Sleep -milliseconds $(1 + $Random.Next($speed)) + } -exit 0 + exit 0 +} catch { + Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}