Update Script PREVIEW.ps1

This commit is contained in:
OlaYZen 2022-09-19 13:01:29 +02:00 committed by GitHub
parent 49ca19624a
commit 2223230719
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -6,10 +6,16 @@ if (!([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]:
if (Get-Module -ListAvailable -Name PSWindowsUpdate) { if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
Write-Host "PSWindowsUpdate exists" Write-Host "PSWindowsUpdate exists"
if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
Import-Module PSWindowsUpdate
}
} }
else { else {
Write-Host "PSWindowsUpdate does not exist, Installing ..." Write-Host "PSWindowsUpdate does not exist, Installing ..."
Install-Module PSWindowsUpdate -force Install-Module PSWindowsUpdate -force
if (Get-Module -ListAvailable -Name PSWindowsUpdate) {
Import-Module PSWindowsUpdate
}
} }
function installwingetjson function installwingetjson
{ {