Skip to content

Commit

Permalink
Update post_install.ps1 to detect edge on Server2025 (#2345)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkatyl authored Aug 16, 2024
1 parent 3c7d909 commit ededada
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions daisy_workflows/image_build/windows/post_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -559,25 +559,25 @@ function Install-DriverPackages {
}

function Update-Edge {
$taskExistEdgeUpdate = Get-ScheduledTask | Where-Object {$_.TaskName -like 'MicrosoftEdgeUpdateTaskMachineCore' }
if($taskExistEdgeUpdate) {
Start-ScheduledTask -TaskName MicrosoftEdgeUpdateTaskMachineCore
$taskExistEdgeUpdateCore = Get-ScheduledTask | Where-Object {$_.TaskName -like 'MicrosoftEdgeUpdateTaskMachineCore*' }
if($taskExistEdgeUpdateCore) {
Start-ScheduledTask -TaskName $taskExistEdgeUpdateCore.TaskName
Write-Host 'Microsoft Edge Core updater started.'
} else {
Write-Host 'Microsoft Edge updater task MicrosoftEdgeUpdateTaskMachineCore not present.'
}

$taskExistEdgeUpdate = Get-ScheduledTask | Where-Object {$_.TaskName -like 'MicrosoftEdgeUpdateTaskMachineUA' }
if($taskExistEdgeUpdate) {
Start-ScheduledTask -TaskName 'MicrosoftEdgeUpdateTaskMachineUA'
$taskExistEdgeUpdateUA = Get-ScheduledTask | Where-Object {$_.TaskName -like 'MicrosoftEdgeUpdateTaskMachineUA*' }
if($taskExistEdgeUpdateUA) {
Start-ScheduledTask -TaskName $taskExistEdgeUpdateUA.TaskName
Write-Host 'Microsoft Edge UA updater started.'
} else {
Write-Host 'Microsoft Edge updater task MicrosoftEdgeUpdateTaskMachineUA not present.'
}

# Check if the Edge update is finished before continuing
if (Test-Path "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe") {
while ((Get-Item "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe").LastWriteTime -lt (Get-Date).AddMonths(-2)) {
while ((Get-Item "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe").LastWriteTime -lt (Get-Date).AddMonths(-1)) {
Write-Host "Microsoft Edge updater not completed; version found: $((Get-Item "C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe").VersionInfo.ProductVersion)"
Start-Sleep -s 30
}
Expand Down

0 comments on commit ededada

Please sign in to comment.