mirror of
https://github.com/actions/runner-images.git
synced 2025-12-13 12:48:18 +00:00
Update anka clean script (#8537)
This commit is contained in:
@@ -90,7 +90,7 @@ function Invoke-SoftwareUpdate {
|
|||||||
|
|
||||||
Write-Host "`t[*] Fetching Software Updates ready to install on '$TemplateName' VM:"
|
Write-Host "`t[*] Fetching Software Updates ready to install on '$TemplateName' VM:"
|
||||||
Show-StringWithFormat $newUpdates
|
Show-StringWithFormat $newUpdates
|
||||||
$listOfNewUpdates = $($($newUpdates.Split("*")).Split("Title") | Where-Object {$_ -match "Label:"}).Replace("Label: ", '')
|
$listOfNewUpdates = $($($newUpdates.Split("*")).Split("Title") | Where-Object {$_ -match "Label:"}).Replace("Label: ", '') | Where-Object {$_ -notmatch "macOS Sonoma"}
|
||||||
Write-Host "`t[*] Installing Software Updates on '$TemplateName' VM:"
|
Write-Host "`t[*] Installing Software Updates on '$TemplateName' VM:"
|
||||||
Install-SoftwareUpdate -HostName $ipAddress -listOfUpdates $listOfNewUpdates -Password $Password | Show-StringWithFormat
|
Install-SoftwareUpdate -HostName $ipAddress -listOfUpdates $listOfNewUpdates -Password $Password | Show-StringWithFormat
|
||||||
|
|
||||||
@@ -99,7 +99,7 @@ function Invoke-SoftwareUpdate {
|
|||||||
$listOfNewUpdates = $newUpdates.split('*').Trim('')
|
$listOfNewUpdates = $newUpdates.split('*').Trim('')
|
||||||
foreach ($newupdate in $listOfNewUpdates) {
|
foreach ($newupdate in $listOfNewUpdates) {
|
||||||
# Will be True if the value is not Venture, not empty, and contains "Action: restart" words
|
# 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))) {
|
if ($newupdate.Contains("Action: restart") -and (!$newupdate.Contains("macOS Ventura") -or !$newupdate.Contains("macOS Sonoma")) -and (-not [String]::IsNullOrEmpty($newupdate))) {
|
||||||
Write-Host "`t[*] Sleep 60 seconds before the software updates have been installed"
|
Write-Host "`t[*] Sleep 60 seconds before the software updates have been installed"
|
||||||
Start-Sleep -Seconds 60
|
Start-Sleep -Seconds 60
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user