From 6c58860122e8c9179e41f16dec3f7c055be7de90 Mon Sep 17 00:00:00 2001 From: Stefan Hubertus Date: Thu, 29 Jan 2026 11:15:36 +0100 Subject: [PATCH] Force installation and check for installed TeamViewerPS module. --- TeamViewerADConnector/Invoke-InstallTeamViewerPSModule.ps1 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TeamViewerADConnector/Invoke-InstallTeamViewerPSModule.ps1 b/TeamViewerADConnector/Invoke-InstallTeamViewerPSModule.ps1 index b9c420d..f5f1531 100644 --- a/TeamViewerADConnector/Invoke-InstallTeamViewerPSModule.ps1 +++ b/TeamViewerADConnector/Invoke-InstallTeamViewerPSModule.ps1 @@ -3,9 +3,9 @@ param( [string]$ModuleName = 'TeamViewerPS' ) -if (-not (Get-Module -Name $ModuleName -ErrorAction SilentlyContinue)) { +if (-not (Get-InstalledModule -Name $ModuleName -ErrorAction SilentlyContinue)) { try { - Import-Module -Name $ModuleName -ErrorAction Stop + Install-Module -Name $ModuleName -Force -ErrorAction Stop Write-Verbose "Module $Modulename was succesfully installed" } catch {