Add list-os-updates.ps1

This commit is contained in:
Markus Fleschutz 2021-04-26 07:41:22 +02:00
parent 8dff4e1012
commit 6f5af190c9
3 changed files with 29 additions and 2 deletions

View File

@ -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

1 Script Description
102 list-mysql-tables.ps1 lists the MySQL server tables
103 list-network-shares.ps1 lists the network shares of the local computer
104 list-news.ps1 lists the latest news
105 list-os-releases.ps1 lists OS releases and download URL lists operating system releases and download URL
106 list-os-updates.ps1 lists operating system updates
107 list-printers.ps1 lists all printer known to the computer
108 list-processes.ps1 lists the local computer processes
109 list-profiles.ps1 lists your PowerShell profiles

View File

@ -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

25
Scripts/list-os-updates.ps1 Executable file
View File

@ -0,0 +1,25 @@
<#
.SYNTAX list-os-updates.ps1 [<RSS-URL>] [<max-count>]
.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
}