mirror of
https://github.com/actions/runner-images-sangeeth.git
synced 2025-12-17 15:28:16 +00:00
Install-WindowsUpdates fixes (#1071)
This commit is contained in:
@@ -552,12 +552,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"scripts":[
|
|
||||||
"{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "windows-shell",
|
"type": "windows-shell",
|
||||||
"inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"]
|
"inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"]
|
||||||
@@ -1010,6 +1004,18 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-DiskSpace.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-DiskSpace.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1"
|
||||||
|
],
|
||||||
|
"elevated_user": "{{user `install_user`}}",
|
||||||
|
"elevated_password": "{{user `install_password`}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "windows-restart",
|
||||||
|
"restart_timeout": "10m"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"inline": [
|
"inline": [
|
||||||
|
|||||||
@@ -513,12 +513,6 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1"
|
"{{ template_dir }}/scripts/Installers/Install-DotnetSDK.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"type": "powershell",
|
|
||||||
"scripts":[
|
|
||||||
"{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"type": "windows-shell",
|
"type": "windows-shell",
|
||||||
"inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"]
|
"inline": ["wmic product where \"name like '%%microsoft azure powershell%%'\" call uninstall /nointeractive"]
|
||||||
@@ -1001,6 +995,18 @@
|
|||||||
"{{ template_dir }}/scripts/Installers/Validate-DiskSpace.ps1"
|
"{{ template_dir }}/scripts/Installers/Validate-DiskSpace.ps1"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "powershell",
|
||||||
|
"scripts":[
|
||||||
|
"{{ template_dir }}/scripts/Installers/Install-WindowsUpdates.ps1"
|
||||||
|
],
|
||||||
|
"elevated_user": "{{user `install_user`}}",
|
||||||
|
"elevated_password": "{{user `install_password`}}"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "windows-restart",
|
||||||
|
"restart_timeout": "10m"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "powershell",
|
"type": "powershell",
|
||||||
"inline": [
|
"inline": [
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
## File: Install-WindowsUpdates.ps1
|
## File: Install-WindowsUpdates.ps1
|
||||||
## Desc: Install Windows Updates.
|
## Desc: Install Windows Updates.
|
||||||
## Should be run at end just before Antivirus.
|
## Should be run at end, just before SoftwareReport and Finalize-VM.ps1.
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
Write-Host "Run windows updates"
|
Write-Host "Run windows updates"
|
||||||
Install-Module -Name PSWindowsUpdate -Force -AllowClobber
|
Install-Module -Name PSWindowsUpdate -Force -AllowClobber
|
||||||
Get-WUInstall -WindowsUpdate -AcceptAll -Install -UpdateType Software -IgnoreReboot
|
|
||||||
Get-WUInstall -MicrosoftUpdate -AcceptAll -Install -IgnoreUserInput -IgnoreReboot
|
Get-WUInstall -MicrosoftUpdate -AcceptAll -Install -IgnoreUserInput -IgnoreReboot
|
||||||
|
|||||||
@@ -3,9 +3,8 @@ function Get-OSName {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function Get-OSVersion {
|
function Get-OSVersion {
|
||||||
$systemInfo = Get-CimInstance -ClassName Win32_OperatingSystem
|
$OSVersion = (Get-CimInstance -ClassName Win32_OperatingSystem).Version
|
||||||
$OSVersion = $systemInfo.Version
|
$OSBuild = (Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion' UBR).UBR
|
||||||
$OSBuild = $systemInfo.BuildNumber
|
|
||||||
return "OS Version: $OSVersion Build $OSBuild"
|
return "OS Version: $OSVersion Build $OSBuild"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user