Added news.ps1

This commit is contained in:
Markus Fleschutz 2020-06-19 15:52:01 +00:00
parent ad22abe669
commit 6de6f040e7

19
Scripts/news.ps1 Executable file
View File

@ -0,0 +1,19 @@
#!/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