Fixed install and deploy tools
This commit is contained in:
@@ -16,6 +16,9 @@ if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent
|
||||
}
|
||||
}
|
||||
|
||||
#Disable Windows updates service
|
||||
Set-Service -Name "wuauserv" -Status Stopped -StartupType Disabled
|
||||
|
||||
Write-Output "Checking activation status..."
|
||||
$ta = Get-CimInstance -ClassName SoftwareLicensingProduct -Filter "PartialProductKey IS NOT NULL" | Where-Object -Property Name -Like "Windows*"
|
||||
if ($ta.LicenseStatus -eq 1) {Write-Outpute-Output "Activation [OK]"} else {Write-Output "Activation [Error, Opening settings]";Start-Process "ms-settings:activation"; pause }
|
||||
@@ -30,6 +33,9 @@ Write-Output "Checking Chocolatey package updates"
|
||||
choco upgrade -y all
|
||||
Write-Output " Chocolatey updates [OK]"
|
||||
|
||||
#Enable Windows updates service
|
||||
Set-Service -Name "wuauserv" -Status Stopped -StartupType Manual
|
||||
|
||||
Write-Output "Checking Windows updates"
|
||||
Import-Module PSWindowsUpdate
|
||||
Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot -IgnoreRebootRequired -Install
|
||||
|
||||
Reference in New Issue
Block a user