mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-28 14:17:35 +02:00
Updated simulate-typewriter.ps1
This commit is contained in:
parent
f12aaf0575
commit
4b621987ba
@ -7,13 +7,14 @@
|
|||||||
# License: CC0
|
# License: CC0
|
||||||
|
|
||||||
param([string]$URL)
|
param([string]$URL)
|
||||||
if ($URL -eq "" ) {
|
|
||||||
$URL = read-host "Enter URL to download"
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
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
|
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent $URL --directory-prefix . --no-verbose
|
||||||
write-host "✔️ Done."
|
Write-Output "OK."
|
||||||
exit 0
|
exit 0
|
||||||
} catch {
|
} catch {
|
||||||
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
@ -10,14 +10,19 @@ param([string]$message)
|
|||||||
if ($message -eq "" ) {
|
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"
|
$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
|
try {
|
||||||
$Random = New-Object System.Random
|
$Random = New-Object System.Random
|
||||||
|
|
||||||
$message -split '' |
|
$message -split '' |
|
||||||
ForEach-Object {
|
ForEach-Object {
|
||||||
Write-Host -nonewline $_
|
Write-Host -nonewline $_
|
||||||
Start-Sleep -milliseconds $(1 + $Random.Next($Speed))
|
Start-Sleep -milliseconds $(1 + $Random.Next($speed))
|
||||||
}
|
}
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
} catch {
|
||||||
|
Write-Error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user