diff --git a/packer/preseed/Server2019/pvscsi/Autounattend.xml b/packer/preseed/Server2019/pvscsi/Autounattend.xml index fcdcd74..e2ef660 100644 --- a/packer/preseed/Server2019/pvscsi/Autounattend.xml +++ b/packer/preseed/Server2019/pvscsi/Autounattend.xml @@ -1,7 +1,7 @@ - + @@ -9,6 +9,8 @@ + + diff --git a/packer/windowsserver2019.pkr.hcl b/packer/windowsserver2019.pkr.hcl index f3167c6..742bcfa 100644 --- a/packer/windowsserver2019.pkr.hcl +++ b/packer/windowsserver2019.pkr.hcl @@ -185,20 +185,24 @@ source "vsphere-iso" "srv2019-baremetal" { } build { + // sources = [ + // "source.vsphere-iso.srv2019-template", + // "source.vsphere-iso.srv2019-virtual", + // "source.vsphere-iso.srv2019-baremetal" + // ] sources = [ "source.vsphere-iso.srv2019-template", - "source.vsphere-iso.srv2019-virtual", - "source.vsphere-iso.srv2019-baremetal" + "source.vsphere-iso.srv2019-virtual" ] provisioner "windows-update" { } - // provisioner "powershell" { - // scripts = [ - // "scripts/Install-WinGet.ps1" - // ] - // } + provisioner "powershell" { + scripts = [ + "scripts/Install-WinGet.ps1" + ] + } // provisioner "powershell" { // inline = [ // "winget install mozilla.firefox", diff --git a/scripts/Install-WinGet.ps1 b/scripts/Install-WinGet.ps1 index 8248d89..8db7589 100644 --- a/scripts/Install-WinGet.ps1 +++ b/scripts/Install-WinGet.ps1 @@ -52,3 +52,14 @@ $AddAppxPackageSplat = @{ } Add-AppxPackage @AddAppxPackageSplat +# Create reparse point +$SetExecutionAliasSplat = @{ + Path = "$([System.Environment]::SystemDirectory)\winget.exe" + PackageName = "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe" + EntryPoint = "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe!winget" + Target = "$((Get-AppxPackage Microsoft.DesktopAppInstaller).InstallLocation)\AppInstallerCLI.exe" + AppType = 'Desktop' + Version = 3 +} +Set-ExecutionAlias @SetExecutionAliasSplat +& explorer.exe "shell:appsFolder\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe!winget" \ No newline at end of file