From 6f5af190c97ba5b7ad8b1085665cd47840f6eb39 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Mon, 26 Apr 2021 07:41:22 +0200 Subject: [PATCH] Add list-os-updates.ps1 --- Data/scripts.csv | 3 ++- README.md | 3 ++- Scripts/list-os-updates.ps1 | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100755 Scripts/list-os-updates.ps1 diff --git a/Data/scripts.csv b/Data/scripts.csv index 5911d420..b147d6d3 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -102,7 +102,8 @@ list-modules.ps1, lists the PowerShell modules list-mysql-tables.ps1, lists the MySQL server tables list-network-shares.ps1, lists the network shares of the local computer list-news.ps1, lists the latest news -list-os-releases.ps1, lists OS releases and download URL +list-os-releases.ps1, lists operating system releases and download URL +list-os-updates.ps1, lists operating system updates list-printers.ps1, lists all printer known to the computer list-processes.ps1, lists the local computer processes list-profiles.ps1, lists your PowerShell profiles diff --git a/README.md b/README.md index 8dba1805..ddb4a4d9 100644 --- a/README.md +++ b/README.md @@ -187,7 +187,8 @@ Mega Collection of PowerShell Scripts * [list-earthquakes.ps1](Scripts/list-earthquakes.ps1) - lists earthquakes with magnitude >= 6.0 for the last 30 days * [list-mysql-tables.ps1](Scripts/list-mysql-tables.ps1) - lists the MySQL server tables * [list-news.ps1](Scripts/list-news.ps1) - lists the latest news -* [list-os-releases.ps1](Scripts/list-os-releases.ps1) - lists OS releases and download URL +* [list-os-releases.ps1](Scripts/list-os-releases.ps1) - lists operating system releases and download URL +* [list-os-updates.ps1](Scripts/list-os-updates.ps1) - lists operating system updates * [list-random-passwords.ps1](Scripts/list-random-passwords.ps1) - prints a list of random passwords * [list-random-pins.ps1](Scripts/list-random-pins.ps1) - prints a list of random PIN's * [list-sql-tables.ps1](Scripts/list-sql-tables.ps1) - lists the SQL server tables diff --git a/Scripts/list-os-updates.ps1 b/Scripts/list-os-updates.ps1 new file mode 100755 index 00000000..b5d10514 --- /dev/null +++ b/Scripts/list-os-updates.ps1 @@ -0,0 +1,25 @@ +<# +.SYNTAX list-os-updates.ps1 [] [] +.DESCRIPTION lists the latest operating system updates +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +param($RSS_URL = "https://distrowatch.com/news/dwd.xml", [int]$MaxCount = 20) + +try { + & "$PSScriptRoot/write-big.ps1" "OS Updates" + [xml]$Content = (invoke-webRequest -URI $RSS_URL).Content + "`t(by $($Content.rss.channel.title))" + + [int]$Count = 0 + foreach ($item in $Content.rss.channel.item) { + "`t→ $($item.title)" + $Count++ + if ($Count -eq $MaxCount) { break } + } + exit 0 +} catch { + write-error "ERROR: line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}