windows-updater/pswindowsupdate-installer.ps1

25 lines
1019 B
PowerShell
Raw Normal View History

2023-11-29 13:43:50 +00:00
# Script Name: pswindowsupdate-installer.ps1
2023-11-29 15:05:23 +00:00
# Beschreibung: Installiert das Modul 'PSWindowsUpdate' und alle anderen Voraussetzungen per Internet
2023-11-29 13:43:50 +00:00
# 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
2023-11-29 15:05:23 +00:00
# Modifikation: Erste Veröffentlichung
2023-11-29 13:43:50 +00:00
#####################################################
# 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