Update check-health.ps1, list-news.ps1, and write-typewriter.ps1

This commit is contained in:
Markus Fleschutz 2022-10-17 09:49:23 +02:00
parent 59d1220f36
commit deec73527f
3 changed files with 5 additions and 4 deletions

View File

@ -16,8 +16,8 @@
& "$PSScriptRoot/check-time-zone.ps1" & "$PSScriptRoot/check-time-zone.ps1"
& "$PSScriptRoot/check-cpu.ps1" & "$PSScriptRoot/check-cpu.ps1"
& "$PSScriptRoot/check-ram.ps1" & "$PSScriptRoot/check-ram.ps1"
& "$PSScriptRoot/check-smart-devices.ps1"
& "$PSScriptRoot/check-swap-space.ps1" & "$PSScriptRoot/check-swap-space.ps1"
& "$PSScriptRoot/check-smart-devices.ps1"
& "$PSScriptRoot/check-drives.ps1" & "$PSScriptRoot/check-drives.ps1"
& "$PSScriptRoot/check-dns.ps1" & "$PSScriptRoot/check-dns.ps1"
& "$PSScriptRoot/check-ping.ps1" & "$PSScriptRoot/check-ping.ps1"

View File

@ -21,12 +21,13 @@ try {
[xml]$Content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content [xml]$Content = (Invoke-WebRequest -URI $RSS_URL -useBasicParsing).Content
[int]$Count = 1 [int]$Count = 1
foreach ($Item in $Content.rss.channel.item) { foreach ($Item in $Content.rss.channel.item) {
"$($Item.title)" # "→ $($Item.title)"
& "$PSScriptRoot/write-typewriter.ps1" "$($Item.title)" 30 # ms speed
if ($Count++ -eq $MaxCount) { break } if ($Count++ -eq $MaxCount) { break }
} }
$Source = $Content.rss.channel.title $Source = $Content.rss.channel.title
$Date = $Content.rss.channel.pubDate $Date = $Content.rss.channel.pubDate
" Source: $Source (as of $Date)" " Updated: $Date by: $Source"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"

View File

@ -19,11 +19,11 @@ param([string]$text = "`nHello World`n-----------`n* PowerShell is powerful - fu
try { try {
$Random = New-Object System.Random $Random = New-Object System.Random
$text -split '' | ForEach-Object { $text -split '' | ForEach-Object {
Write-Host -noNewline $_ Write-Host -noNewline $_
Start-Sleep -milliseconds $(1 + $Random.Next($speed)) Start-Sleep -milliseconds $(1 + $Random.Next($speed))
} }
Write-Host ""
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"