diff --git a/Script.ps1 b/Script.ps1 index 542e701..6adf6ac 100644 --- a/Script.ps1 +++ b/Script.ps1 @@ -8,10 +8,16 @@ Start-Sleep -Milliseconds 500 if (Get-Module -ListAvailable -Name PSWindowsUpdate) { Write-Host "PSWindowsUpdate exists" + if (Get-Module -ListAvailable -Name PSWindowsUpdate) { + Import-Module PSWindowsUpdate + } } else { Write-Host "PSWindowsUpdate does not exist, Installing ..." Install-Module PSWindowsUpdate -force + if (Get-Module -ListAvailable -Name PSWindowsUpdate) { + Import-Module PSWindowsUpdate + } } function installwingetjson {