Skip to content

Commit

Permalink
Moving to install drivers first (#2273)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkatyl authored Feb 23, 2024
1 parent 916ef27 commit 973bde1
Showing 1 changed file with 6 additions and 15 deletions.
21 changes: 6 additions & 15 deletions daisy_workflows/image_build/windows/post_install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -511,11 +511,6 @@ function Configure-RDP {
}

function Install-Packages {
# Workaround until packaged are updated to specify 'Import-Module Microsoft.PowerShell.Security'
Write-Host 'Limiting PowerShell Module Path'
$backupPSModulePath = $env:PSModulePath
$env:PSModulePath = 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules'

Write-Host 'Installing GCE packages...'
# Install each individually in order to catch individual errors
Run-Command 'C:\ProgramData\GooGet\googet.exe' -root 'C:\ProgramData\GooGet' -noconfirm install google-compute-engine-windows
Expand All @@ -530,10 +525,6 @@ function Install-Packages {
Run-Command 'C:\ProgramData\GooGet\googet.exe' -root 'C:\ProgramData\GooGet' -noconfirm install google-compute-engine-diagnostics
Run-Command 'C:\ProgramData\GooGet\googet.exe' -root 'C:\ProgramData\GooGet' -noconfirm install google-osconfig-agent

# Restoring original PSModulePath
$env:PSModulePath = $backupPSModulePath
Write-Host 'PowerShell Module Path Restored.'

# Google Graphics Array not supported on 2008R2/7 (6.1)
if ($pn -notlike 'Windows Server 2008*' -or $pn -notlike 'Windows 7*') {
Write-Host 'Installing GCE virtual display driver...'
Expand Down Expand Up @@ -634,6 +625,12 @@ try {
# Windows Product Name https://renenyffenegger.ch/notes/Windows/versions/index
$pn = (Get-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion' -Name ProductName).ProductName

# Install script diverges here, since 32-bit googet packages are not in Rapture
if (!$script:x86) {
Install-Packages
Set-Repos
}

Install-PowerShell

# Remove with Win2012 R2 EOL in Oct 2023. Temporary fix for issue following June 2023 .Net update.
Expand All @@ -660,12 +657,6 @@ try {
Configure-RDP
Setup-NTP

# Install script diverges here, since 32-bit googet packages are not in Rapture
if (!$script:x86) {
Install-Packages
Set-Repos
}

Enable-WinRM
Generate-NativeImage

Expand Down

0 comments on commit 973bde1

Please sign in to comment.