mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-10-07 18:41:57 +02:00
20 lines
448 B
PowerShell
20 lines
448 B
PowerShell
|
#!/snap/bin/powershell
|
||
|
#
|
||
|
# Syntax: news.ps1
|
||
|
# Description: print the latest news
|
||
|
# Author: Markus Fleschutz
|
||
|
# Source: github.com/fleschutz/PowerShell
|
||
|
# License: CC0
|
||
|
#
|
||
|
Invoke-WebRequest -Uri 'https://rss.nytimes.com/services/xml/rss/nyt/HomePage.xml' -OutFile news.temp.xml
|
||
|
|
||
|
[xml]$FileContent = Get-Content news.temp.xml
|
||
|
|
||
|
foreach ($item in $FileContent.rss.channel.item) {
|
||
|
write-output "+++"$item.title
|
||
|
}
|
||
|
|
||
|
remove-item news.temp.xml
|
||
|
|
||
|
exit 0
|