windows-updater/pswindowsupdate-installer.ps1
2023-11-29 16:05:23 +01:00

25 lines
1019 B
PowerShell

# Script Name: pswindowsupdate-installer.ps1
# Beschreibung: Installiert das Modul 'PSWindowsUpdate' und alle anderen Voraussetzungen per Internet
# Lauffähig unter Windows Server 2016, 2019 und 2022
# Aufruf: -
# Autor: Patrick Asmus
# Web: https://www.media-techport.de
# Git-Reposit.: https://git.media-techport.de/scriptos/PSWindowsUpdate.git
# Version: 1.0
# Datum: 29.11.2023
# Modifikation: Erste Veröffentlichung
#####################################################
# Setze TLS 1.2 als Sicherheitsprotokoll
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
# Überprüfe, ob das PowerShellGet-Modul vorhanden ist. Falls nicht, installiere es.
if (-not (Get-Module -Name PowerShellGet -ListAvailable)) {
Install-Module -Name PowerShellGet -Force -AllowClobber
}
# Installiere PSWindowsUpdate-Modul
Install-Module -Name PSWindowsUpdate -Force
# Zeige installiertes PSWindowsUpdate-Modul an
Get-Package -Name PSWindowsUpdate