Update list-news.ps1

This commit is contained in:
Markus Fleschutz 2023-07-26 16:07:11 +02:00
parent 6ea66c2a5a
commit 973e1c9b85

View File

@ -1,6 +1,6 @@
<# <#
.SYNOPSIS .SYNOPSIS
List news List the latest news
.DESCRIPTION .DESCRIPTION
This PowerShell script lists the latest news by using RSS (Really Simple Syndication) feeds. This PowerShell script lists the latest news by using RSS (Really Simple Syndication) feeds.
.PARAMETER RSS_URL .PARAMETER RSS_URL
@ -10,7 +10,9 @@
.PARAMETER Speed .PARAMETER Speed
Specifies the speed to write the text (10 ms by default) Specifies the speed to write the text (10 ms by default)
.EXAMPLE .EXAMPLE
PS> ./list-news PS> ./list-news.ps1
Deadly Mediterranean wildfires kill more than 40
...
.LINK .LINK
https://github.com/fleschutz/PowerShell https://github.com/fleschutz/PowerShell
.NOTES .NOTES
@ -35,8 +37,7 @@ try {
$Date = $Date -Replace "Fri, ","" $Date = $Date -Replace "Fri, ",""
$Date = $Date -Replace "Sat, ","" $Date = $Date -Replace "Sat, ",""
$Date = $Date -Replace "Sun, ","" $Date = $Date -Replace "Sun, ",""
$Copyright = $Content.rss.channel.copyright "(by $Source as of $Date)"
"($Source|$Date|$Copyright)"
exit 0 # success exit 0 # success
} catch { } catch {
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"