Added confirmation for updates in deploy script
This commit is contained in:
@@ -28,11 +28,16 @@ $sysid = Read-Host -Prompt 'Please enter system ID (example: DT001)'
|
||||
Rename-Computer -NewName $sysid
|
||||
Write-Output "System name [OK]"
|
||||
|
||||
|
||||
#Chocolaty software updates
|
||||
$confirmSupdates = Read-Host "Run Software updates? (y/n)"
|
||||
if ( $confirmSupdates -eq 'y'){
|
||||
Write-Output "Checking Chocolatey package updates"
|
||||
choco upgrade -y all
|
||||
Write-Output " Chocolatey updates [OK]"
|
||||
}
|
||||
|
||||
$confirmWupdates = Read-Host "Run Windows updates? (y/n)"
|
||||
if ( $confirmWupdates -eq 'y'){
|
||||
#Enable Windows updates service
|
||||
Set-Service -Name "wuauserv" -Status Stopped -StartupType Manual
|
||||
|
||||
@@ -40,6 +45,7 @@ Write-Output "Checking Windows updates"
|
||||
Import-Module PSWindowsUpdate
|
||||
Get-WUInstall -MicrosoftUpdate -AcceptAll -IgnoreReboot -IgnoreRebootRequired -Install
|
||||
Write-Output " Windows updates [OK]"
|
||||
}
|
||||
|
||||
#Removing Created Shortcuts
|
||||
Remove-Item C:\Users\Public\Desktop\*.lnk
|
||||
|
||||
Reference in New Issue
Block a user