From 0365a15eb69e3d0a9a8fd251ad7cea07bb160ec1 Mon Sep 17 00:00:00 2001 From: Aleksandr Chebotov <47745270+al-cheb@users.noreply.github.com> Date: Mon, 22 Nov 2021 15:18:46 +0300 Subject: [PATCH] Anka disable beta seed (#4564) * Remove current beta seed program * format unenroll output --- images.CI/macos/anka/CreateCleanAnkaTemplate.ps1 | 4 ++++ images.CI/macos/anka/Service.Helpers.psm1 | 11 +++++++++++ 2 files changed, 15 insertions(+) diff --git a/images.CI/macos/anka/CreateCleanAnkaTemplate.ps1 b/images.CI/macos/anka/CreateCleanAnkaTemplate.ps1 index 28448e254..ff38c1b6f 100644 --- a/images.CI/macos/anka/CreateCleanAnkaTemplate.ps1 +++ b/images.CI/macos/anka/CreateCleanAnkaTemplate.ps1 @@ -64,6 +64,10 @@ function Invoke-SoftwareUpdate { $ipAddress = Get-AnkaVMIPAddress -VMName $TemplateName + # Unenroll Seed + Write-Host "`t[*] Reseting the seed before requesting stable versions" + Remove-CurrentBetaSeed -HostName $ipAddress | Show-StringWithFormat + # Install Software Updates # Security updates may not be able to install(hang, freeze) when AutoLogon is turned off Write-Host "`t[*] Finding available software" diff --git a/images.CI/macos/anka/Service.Helpers.psm1 b/images.CI/macos/anka/Service.Helpers.psm1 index fce822d67..2c5ba9bdd 100644 --- a/images.CI/macos/anka/Service.Helpers.psm1 +++ b/images.CI/macos/anka/Service.Helpers.psm1 @@ -232,6 +232,17 @@ function Show-StringWithFormat { } } +function Remove-CurrentBetaSeed { + param( + [Parameter(Mandatory)] + [ValidateNotNullOrEmpty()] + [string] $HostName + ) + + $command = "sudo /System/Library/PrivateFrameworks/Seeding.framework/Versions/Current/Resources/seedutil unenroll" + Invoke-SSHPassCommand -HostName $HostName -Command $command | Out-String +} + function Test-AutoLogon { param( [Parameter(Mandatory)]