mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-08 17:14:28 +01:00
Updated simulate-typewriter.ps1
This commit is contained in:
parent
f12aaf0575
commit
4b621987ba
@ -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])"
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user