zwischenstand nr2

This commit is contained in:
scriptos 2023-11-29 14:44:37 +01:00
parent d7821e86e4
commit 5d36f31544

View File

@ -17,22 +17,12 @@ function Format-DeutschesDatum ([datetime] $date) {
# Variablen # Variablen
$LogPfad = "C:\logs\windows-updater.log" $LogPfad = "C:\logs\windows-updater.log"
#$ModulPfad = Join-Path -Path $PSScriptRoot -ChildPath "modul-pswindowsupdate"
#$ModulPfad = "C:\scripts\PSWindowsUpdate\2.2.1.2\PSWindowsUpdate.psm1"
$ModulVerzeichnis = Join-Path -Path $PSScriptRoot -ChildPath "Module\PSWindowsUpdate"
$env:PSModulePath += ";C:\BenutzerdefinierteModule"
# Relativer Modulpfad zum $env:PSModulePath hinzufügen
$ModulVerzeichnis = Join-Path -Path $PSScriptRoot -ChildPath "Module" $ModulVerzeichnis = Join-Path -Path $PSScriptRoot -ChildPath "Module"
$env:PSModulePath += ";$ModulVerzeichnis" $env:PSModulePath += ";$ModulVerzeichnis"
# Importiere das PSWindowsUpdate-Modul # Importiere das PSWindowsUpdate-Modul
Import-Module -Name "PSWindowsUpdate" -Verbose Import-Module -Name "PSWindowsUpdate" -Verbose
# Importiere das PSWindowsUpdate-Modul
Import-Module -Name $ModulPfad -Verbose
# Überprüfe, ob das Modul erfolgreich geladen wurde # Überprüfe, ob das Modul erfolgreich geladen wurde
if (Get-Module -Name PSWindowsUpdate -ListAvailable) { if (Get-Module -Name PSWindowsUpdate -ListAvailable) {
Write-Host "PSWindowsUpdate-Modul erfolgreich geladen." Write-Host "PSWindowsUpdate-Modul erfolgreich geladen."