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