mirror of
https://github.com/actions/runner-images.git
synced 2025-12-15 22:26:56 +00:00
Add exclusion for macOS-12 for Action: restart (#7511)
This commit is contained in:
@@ -86,22 +86,27 @@ function Invoke-SoftwareUpdate {
|
|||||||
Install-SoftwareUpdate -HostName $ipAddress -listOfUpdates $listOfNewUpdates | Show-StringWithFormat
|
Install-SoftwareUpdate -HostName $ipAddress -listOfUpdates $listOfNewUpdates | Show-StringWithFormat
|
||||||
|
|
||||||
# Check if Action: restart
|
# Check if Action: restart
|
||||||
if ($newUpdates.Contains("Action: restart")) {
|
# Make an array of updates
|
||||||
Write-Host "`t[*] Sleep 60 seconds before the software updates have been installed"
|
$listOfNewUpdates = $newUpdates.split('*').Trim('')
|
||||||
Start-Sleep -Seconds 60
|
foreach ($newupdate in $listOfNewUpdates) {
|
||||||
|
# Will be True if the value is not Venture, not empty, and contains "Action: restart" words
|
||||||
|
if ($newupdate.Contains("Action: restart") -and !$newupdate.Contains("macOS Ventura") -and (-not [String]::IsNullOrEmpty($newupdate))) {
|
||||||
|
Write-Host "`t[*] Sleep 60 seconds before the software updates have been installed"
|
||||||
|
Start-Sleep -Seconds 60
|
||||||
|
|
||||||
Write-Host "`t[*] Waiting for loginwindow process"
|
Write-Host "`t[*] Waiting for loginwindow process"
|
||||||
Wait-LoginWindow -HostName $ipAddress | Show-StringWithFormat
|
Wait-LoginWindow -HostName $ipAddress | Show-StringWithFormat
|
||||||
|
|
||||||
# Re-enable AutoLogon after installing a new security software update
|
# Re-enable AutoLogon after installing a new security software update
|
||||||
Invoke-EnableAutoLogon
|
Invoke-EnableAutoLogon
|
||||||
|
|
||||||
# Check software updates have been installed
|
# Check software updates have been installed
|
||||||
$updates = Get-SoftwareUpdate -HostName $ipAddress
|
$updates = Get-SoftwareUpdate -HostName $ipAddress
|
||||||
if ($updates.Contains("Action: restart")) {
|
if ($updates.Contains("Action: restart")) {
|
||||||
Write-Host "`t[x] Software updates failed to install: $updates"
|
Write-Host "`t[x] Software updates failed to install: "
|
||||||
Show-StringWithFormat $updates
|
Show-StringWithFormat $updates
|
||||||
exit 1
|
exit 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user