foreach ($module in @("PSWindowsUpdate")){ if (-not (Get-Module -ListAvailable -Name $module)) { Install-Module $module -Scope CurrentUser } if (-not (Get-Module $module)) { Import-Module $module } } Get-WindowsUpdate # Get-WindowsUpdate -KBArticleID "KB4592449" -Install # Install-WindowsUpdate