mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-06 08:34:49 +02:00
Added news.ps1
This commit is contained in:
parent
ad22abe669
commit
6de6f040e7
19
Scripts/news.ps1
Executable file
19
Scripts/news.ps1
Executable 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
|
Loading…
Reference in New Issue
Block a user