The BYOC Hyper-V script fails on Chocolatey because the Windows Server image doesn’t have .net-4.8 installed first

nbrink's Avatar

nbrink

23 Jan, 2026 03:25 PM

I am using this command:

Connect-AppVeyorToHyperV -AppVeyorUrl https://ci.appveyor.com -ApiToken «redacted» -CpuCores 6 -RamMb 4096 -ImageName "vs17 SQLEXPRESS12" -ImageOs "Windows" -ImageTemplate "minimal-windows-server.json" -ImageFeatures "dotnet_devpacks,dotnet_core_sdks,nodejs_latest,vs2022" -ImageCustomScript "" -ImageCustomScriptAfterReboot ""

I took out my custom script and API Token.

It outputs a bunch of things.

First, I am affected by the “press any key to continue” issue. I have to always manually restart the VM and then press the any key manually. I think that maybe the boot delay needs to be set to -1 as suggested here.

That aside, the .net-8.0 issue shows up later in the process. I think either chocolatey needs to be pinned to an older version which supports the version of .net shipped with windows2019 or a step which installs WU needs to run first or .net-4.8 needs to be explicitly installed by the scripts first. Since my custom initialization commands don’t run until after these ones, I can’t do anything about this without AppVeyor changing the script themselves. Is there a way for me to use a custom/forked version of the build-images so that I can try to fix this for myself and test a contribution?

Checking AppVeyor API access...

Checking if Hyper-V tools are installed...
WARNING:
This command will create Hyper-V resources such as virtual switch and related subnet and NAT. For Linux VMs it will     also create a new firewall rule. Also, it will run Hashicorp Packer which will create its own temporary Hyper-V         resources and leave VHD for future use by AppVeyor build VMs.                                                                                                                                                                                   If this server contains production resources you might consider using separate one.                                     
Press Enter to continue or Ctrl-C to exit the command. Use '-SkipDisclaimer' switch parameter to skip this message next
 time.



    Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp                                                                                                                                                                                                                                                                                               Mode                 LastWriteTime         Length Name                                                                  ----                 -------------         ------ ----                                                                  d-----         1/22/2026  10:35 PM                iso-source                                                            

    Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp\iso


Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----         1/22/2026  10:35 PM        1245184 minimal-windows-server.iso

Getting or creating virtual switch appveyor-NAT-Switch...
New-NetNAT : You were not connected because a duplicate name exists on the network. If joining a domain, go to System
in Control Panel to change the computer name and try again. If joining a workgroup, choose another workgroup name.
At C:\Users\binki\Documents\WindowsPowerShell\Modules\AppVeyorBYOC\1.0.192\Connect-AppVeyorToHyperV.ps1:372 char:9
+         New-NetNAT -Name $natNetwork -InternalIPInterfaceAddressPrefi ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (MSFT_NetNat:root/StandardCimv2/MSFT_NetNat) [New-NetNat], CimException
    + FullyQualifiedErrorId : Windows System Error 52,New-NetNat


Checking if Hashicorp Packer version 1.13.2 is installed...
Downloading Packer version 1.13.2 to temporary folder...                                                                Using C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB9DE.tmp\packer                                                                                                                                                                         Running Packer to create a basic build VM VHD...                                                                        WARNING: Add '-VhdPath' parameter with if you want to to skip Packer build and and reuse existing VHD.                  

Packer progress:

hyperv-iso output will be in this color.

Warnings for build 'hyperv-iso':

* For nested virtualization, when virtualization extension is enabled, mac spoofing should be allowed.                                                                                                                                          ==> hyperv-iso: Creating build directory...                                                                             ==> hyperv-iso: Retrieving ISO                                                                                          ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562
==> hyperv-iso: https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562 => C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso
==> hyperv-iso: Creating switch 'appveyor-NAT-Switch' if required...
==> hyperv-iso:     switch 'appveyor-NAT-Switch' already exists. Will not delete on cleanup...
==> hyperv-iso: Creating virtual machine...
==> hyperv-iso: Enabling Integration Service...
==> hyperv-iso: Setting boot drive to os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
==> hyperv-iso: Mounting os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
==> hyperv-iso: Skipping mounting Integration Services Setup Disk...
==> hyperv-iso: Mounting secondary DVD images...
==> hyperv-iso: Mounting secondary dvd drive C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/iso/minimal-windows-server.iso ...
==> hyperv-iso: Configuring vlan...
==> hyperv-iso: Determine Host IP for HyperV machine...
==> hyperv-iso: Host IP for the HyperV machine: 10.118.232.1
==> hyperv-iso: Attempting to connect with vmconnect...
==> hyperv-iso: Starting the virtual machine...
==> hyperv-iso: Waiting 1s for boot...
==> hyperv-iso: Typing the boot command...
==> hyperv-iso: Waiting for WinRM to become available...
    hyperv-iso: WinRM connected.
==> hyperv-iso: #< CLIXML
==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> hyperv-iso: Connected to WinRM!
==> hyperv-iso: Provisioning with Powershell...
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/create_appveyor_user.ps1
==> hyperv-iso: The account already exists.
    hyperv-iso: Creating AppVeyor user
    hyperv-iso: ======================
    hyperv-iso: Auth
    hyperv-iso:     Basic = true
    hyperv-iso:     Kerberos = true
    hyperv-iso:     Negotiate = true
    hyperv-iso:     Certificate = false
    hyperv-iso:     CredSSP = false
    hyperv-iso:     CbtHardeningLevel = Relaxed
    hyperv-iso:
    hyperv-iso: User created
==> hyperv-iso:
==> hyperv-iso: More help is available by typing NET HELPMSG 2224.
==> hyperv-iso:
==> hyperv-iso: System error 1378 has occurred.
==> hyperv-iso:
==> hyperv-iso: The specified account name is already a member of the group.
==> hyperv-iso:
==> hyperv-iso: Provisioning with Powershell...
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\powershell-provisioner767670731
    hyperv-iso: Current user: appveyor-2019\appveyor
==> hyperv-iso: Provisioning with Powershell...
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/init_server.ps1
    hyperv-iso: Disabling UAC
    hyperv-iso: =============
    hyperv-iso: User Access Control (UAC) has been disabled.
    hyperv-iso: Changing PS execution policy to Unrestricted
    hyperv-iso: ============================================
    hyperv-iso: PS policy updated
    hyperv-iso: Disabling Server Manager auto-start
    hyperv-iso: ===================================
    hyperv-iso: Disabled Server Manager at logon for all users
    hyperv-iso: Disabled Server Manager for current user
    hyperv-iso: Disabling Windows Error Reporting (WER)
    hyperv-iso: =======================================
    hyperv-iso: Windows Error Reporting (WER) dialog has been disabled.
    hyperv-iso: Disabling Internet Explorer ESC
    hyperv-iso: ===============================
    hyperv-iso: IE Enhanced Security Configuration (ESC) has been disabled.
    hyperv-iso: Disabling Internet Explorer Welcome Screen
    hyperv-iso: ==========================================
    hyperv-iso:
    hyperv-iso:
    hyperv-iso:     Hive: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer
    hyperv-iso:
    hyperv-iso:
    hyperv-iso: Name                           Property
    hyperv-iso: ----                           --------
    hyperv-iso: Main                           (default) : 1
    hyperv-iso: Disabled IE Welcome screen
    hyperv-iso: Disabling Antivirus
    hyperv-iso: ===================
    hyperv-iso: Disabling Windows Updates
    hyperv-iso: =========================
    hyperv-iso: Disabled Windows Update
    hyperv-iso: WinRM - allow * hosts
    hyperv-iso: =====================
    hyperv-iso: Client
    hyperv-iso:     NetworkDelayms = 5000
    hyperv-iso:     URLPrefix = wsman
    hyperv-iso:     AllowUnencrypted = false
    hyperv-iso:     Auth
    hyperv-iso:         Basic = true
    hyperv-iso:         Digest = true
    hyperv-iso:         Kerberos = true
    hyperv-iso:         Negotiate = true
    hyperv-iso:         Certificate = true
    hyperv-iso:         CredSSP = false
    hyperv-iso:     DefaultPorts
    hyperv-iso:         HTTP = 5985
    hyperv-iso:         HTTPS = 5986
    hyperv-iso:     TrustedHosts = *
    hyperv-iso:
    hyperv-iso: WinRM configured
    hyperv-iso: Allow RDP connections
    hyperv-iso: =====================
    hyperv-iso: RDP connections enabled
    hyperv-iso: Disabling new network location wizard
    hyperv-iso: =====================================
    hyperv-iso: The operation completed successfully.
    hyperv-iso:
    hyperv-iso: The operation completed successfully.
    hyperv-iso:
    hyperv-iso: Network location wizard disabled
    hyperv-iso: Switch time zone to UTC
    hyperv-iso: ========================
    hyperv-iso: Time zone switched
    hyperv-iso: Installing .NET 3.5
    hyperv-iso: ===================
    hyperv-iso:
    hyperv-iso: Success       : True
    hyperv-iso: RestartNeeded : No
    hyperv-iso: FeatureResult : {.NET Framework 3.5 (includes .NET 2.0 and 3.0), .NET Framework 3.5 Features}
    hyperv-iso: ExitCode      : Success
    hyperv-iso:
    hyperv-iso: .NET 3.5 installed
    hyperv-iso: Disable .NET NGEN service and Windows updates
    hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64
    hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319
    hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical
    hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical
==> hyperv-iso: Restarting Machine
==> hyperv-iso: Waiting for machine to restart...
==> hyperv-iso: A system shutdown is in progress.(1115)
    hyperv-iso: APPVEYOR-2019 restarted.
==> hyperv-iso: #< CLIXML
==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
==> hyperv-iso: Machine successfully restarted, moving on
==> hyperv-iso: Provisioning with Powershell...
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/activate_avma.ps1
==> hyperv-iso: Uploading C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/path-utils.psm1 => C:/Users/appveyor/AppData/Local/Temp/path-utils.psm1
==> hyperv-iso: Provisioning with Powershell...
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/install_path_utils.ps1
    hyperv-iso: Installing Path-Utils
    hyperv-iso: =====================
    hyperv-iso:
    hyperv-iso:
    hyperv-iso:     Directory: C:\Users\appveyor\Documents\WindowsPowerShell\Modules
    hyperv-iso:
    hyperv-iso:
    hyperv-iso: Mode                LastWriteTime         Length Name
    hyperv-iso: ----                -------------         ------ ----
    hyperv-iso: d-----        1/23/2026   6:50 AM                path-utils
    hyperv-iso: Path-Utils installed
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/install_powershell_core.ps1
    hyperv-iso: Installing PowerShell Core 7.4.6
    hyperv-iso: ==========================
    hyperv-iso: Downloading...
    hyperv-iso: Installing...
    hyperv-iso: PowerShell 7.4.6
    hyperv-iso: PowerShell Core Installed
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/install_powershell_get.ps1
    hyperv-iso: Installing PowerShellGet
    hyperv-iso: ========================
    hyperv-iso:
    hyperv-iso: Name                           Version          Source           Summary
    hyperv-iso: ----                           -------          ------           -------
    hyperv-iso: nuget                          2.8.5.208        https://cdn.o... NuGet provider for the OneGet meta-package manager
    hyperv-iso: PowerShellGet installed
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/install_7zip.ps1
    hyperv-iso: Installing 7-Zip
    hyperv-iso: ================
    hyperv-iso: 7-Zip installed
==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmpB077.tmp/scripts/Windows/install_chocolatey.ps1
    hyperv-iso: Installing Chocolatey
    hyperv-iso: =====================
    hyperv-iso: Installing Chocolatey...
    hyperv-iso: Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
    hyperv-iso: Getting latest version of the Chocolatey package for download.
    hyperv-iso: Not using proxy.
    hyperv-iso: Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0.
    hyperv-iso:
    hyperv-iso: Not using proxy.
    hyperv-iso: Extracting C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall
    hyperv-iso: Installing Chocolatey on the local machine
    hyperv-iso: The registry key for .Net 4.8 was not found or this is forced
    hyperv-iso: Downloading 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe' to 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - the installer is 100+ MBs, so this could take a while on a slow connection.
    hyperv-iso: Installing 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - this may take awhile with no output.
    hyperv-iso: WARNING: .NET Framework 4.8 was installed, but a reboot is required before using Chocolatey CLI.
    hyperv-iso: Creating ChocolateyInstall as an environment variable (targeting 'Machine')
    hyperv-iso:   Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
    hyperv-iso: WARNING: It's very likely you will need to close and reopen your shell
    hyperv-iso:   before you can use choco.
    hyperv-iso: Restricting write permissions to Administrators                                                             hyperv-iso: We are setting up the Chocolatey package repository.                                                        hyperv-iso: The packages themselves go to 'C:\ProgramData\chocolatey\lib'                                               hyperv-iso:   (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).                                                     hyperv-iso: A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'                                    hyperv-iso:   and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
    hyperv-iso:
    hyperv-iso: Creating Chocolatey CLI folders if they do not already exist.
    hyperv-iso:
    hyperv-iso: chocolatey.nupkg file not installed in lib.
    hyperv-iso:  Attempting to locate it from bootstrapper.
    hyperv-iso: PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
    hyperv-iso: WARNING: Not setting tab completion: Profile file does not exist at
    hyperv-iso: 'C:\Users\appveyor\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
    hyperv-iso: Chocolatey CLI (choco.exe) is nearly ready.
    hyperv-iso: You need to restart this machine prior to using choco.
    hyperv-iso: Ensuring Chocolatey commands are on the path
    hyperv-iso: Ensuring chocolatey.nupkg is in the lib folder
    hyperv-iso: 2.6.0
    hyperv-iso: Chocolatey v2.6.0
    hyperv-iso: .NET 4.8 is not installed or may need a reboot to complete installation.
    hyperv-iso: Please install .NET Framework 4.8 manually and reboot the system.
    hyperv-iso: Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'
    hyperv-iso: Chocolatey installed
==> hyperv-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
==> hyperv-iso: Disconnecting from vmconnect...
==> hyperv-iso: Clean up secondary dvd drives...
==> hyperv-iso: Clean up os dvd drive...
==> hyperv-iso: Unregistering and deleting virtual machine...
==> hyperv-iso: Deleting output directory...
==> hyperv-iso: Deleting build directory...
Build 'hyperv-iso' errored: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]

==> Some builds didn't complete successfully and had errors:
--> hyperv-iso: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]

==> Builds finished but no artifacts were created.
WARNING: Packer build failed.
PS C:\WINDOWS\system32>

P.S., when will the ws2022 image be available? It wasn’t an option when I was trying to build this, but I think at this point I am interested in learning how to do my own image build and figure out how to preinstall the AppVeyor guest agent in there.

Thanks!

  1. Support Staff 1 Posted by Owen McDonnell on 23 Jan, 2026 10:40 PM

    Owen McDonnell's Avatar

    Can you try adding dotnet_runtimes to your command, like this.

    Connect-AppVeyorToHyperV -AppVeyorUrl https://ci.appveyor.com -ApiToken «redacted» -CpuCores 6 -RamMb 4096 -ImageName "vs17 SQLEXPRESS12" -ImageOs "Windows" -ImageTemplate "minimal-windows-server.json" -ImageFeatures "dotnet_runtimes, dotnet_devpacks,dotnet_core_sdks,nodejs_latest,vs2022" -ImageCustomScript "" -ImageCustomScriptAfterReboot ""
    
    and let us know if that resolves your issue.
  2. 2 Posted by nbrink on 23 Jan, 2026 11:42 PM

    nbrink's Avatar

    Here is the updated log:

    
    Checking AppVeyor API access...
    
    Checking if Hyper-V tools are installed...
    WARNING:
    This command will create Hyper-V resources such as virtual switch and related subnet and NAT. For Linux VMs it will
    also create a new firewall rule. Also, it will run Hashicorp Packer which will create its own temporary Hyper-V
    resources and leave VHD for future use by AppVeyor build VMs.
                                                                                                                            If this server contains production resources you might consider using separate one.                                                                                                                                                             Press Enter to continue or Ctrl-C to exit the command. Use '-SkipDisclaimer' switch parameter to skip this message next  time.                                                                                                                                                                                                                                          
    
        Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d-----         1/23/2026   2:46 PM                iso-source
    
    
        Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp\iso
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    -a----         1/23/2026   2:46 PM        1245184 minimal-windows-server.iso
    
    Getting or creating virtual switch appveyor-NAT-Switch...
    
    Checking if Hashicorp Packer version 1.13.2 is installed...
    Downloading Packer version 1.13.2 to temporary folder...                                                                Using C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1CD4.tmp\packer                                                                                                                                                                         Running Packer to create a basic build VM VHD...                                                                        WARNING: Add '-VhdPath' parameter with if you want to to skip Packer build and and reuse existing VHD.                  
    
    Packer progress:
    
    hyperv-iso output will be in this color.
    
    Warnings for build 'hyperv-iso':
    
    * For nested virtualization, when virtualization extension is enabled, mac spoofing should be allowed.                                                                                                                                          ==> hyperv-iso: Creating build directory...                                                                             ==> hyperv-iso: Retrieving ISO                                                                                          ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
    ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562
    ==> hyperv-iso: https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562 => C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso
    ==> hyperv-iso: Creating switch 'appveyor-NAT-Switch' if required...
    ==> hyperv-iso:     switch 'appveyor-NAT-Switch' already exists. Will not delete on cleanup...
    ==> hyperv-iso: Creating virtual machine...
    ==> hyperv-iso: Enabling Integration Service...
    ==> hyperv-iso: Setting boot drive to os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
    ==> hyperv-iso: Mounting os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
    ==> hyperv-iso: Skipping mounting Integration Services Setup Disk...
    ==> hyperv-iso: Mounting secondary DVD images...
    ==> hyperv-iso: Mounting secondary dvd drive C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/iso/minimal-windows-server.iso ...
    ==> hyperv-iso: Configuring vlan...
    ==> hyperv-iso: Determine Host IP for HyperV machine...
    ==> hyperv-iso: Host IP for the HyperV machine: 10.118.232.1
    ==> hyperv-iso: Attempting to connect with vmconnect...
    ==> hyperv-iso: Starting the virtual machine...
    ==> hyperv-iso: Waiting 1s for boot...
    ==> hyperv-iso: Typing the boot command...
    ==> hyperv-iso: Waiting for WinRM to become available...
        hyperv-iso: WinRM connected.
    ==> hyperv-iso: #< CLIXML
    ==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
    ==> hyperv-iso: Connected to WinRM!
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/create_appveyor_user.ps1
        hyperv-iso: Creating AppVeyor user
    ==> hyperv-iso: The account already exists.
    ==> hyperv-iso:
        hyperv-iso: ======================
    ==> hyperv-iso: More help is available by typing NET HELPMSG 2224.
    ==> hyperv-iso:
    ==> hyperv-iso: System error 1378 has occurred.
        hyperv-iso: Auth
    ==> hyperv-iso:
        hyperv-iso:     Basic = true
    ==> hyperv-iso: The specified account name is already a member of the group.
    ==> hyperv-iso:
        hyperv-iso:     Kerberos = true
        hyperv-iso:     Negotiate = true
        hyperv-iso:     Certificate = false
        hyperv-iso:     CredSSP = false
        hyperv-iso:     CbtHardeningLevel = Relaxed
        hyperv-iso:
        hyperv-iso: User created
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\powershell-provisioner454202423
        hyperv-iso: Current user: appveyor-2019\appveyor
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/init_server.ps1
        hyperv-iso: Disabling UAC
        hyperv-iso: =============
        hyperv-iso: User Access Control (UAC) has been disabled.
        hyperv-iso: Changing PS execution policy to Unrestricted
        hyperv-iso: ============================================
        hyperv-iso: PS policy updated
        hyperv-iso: Disabling Server Manager auto-start
        hyperv-iso: ===================================
        hyperv-iso: Disabled Server Manager at logon for all users
        hyperv-iso: Disabled Server Manager for current user
        hyperv-iso: Disabling Windows Error Reporting (WER)
        hyperv-iso: =======================================
        hyperv-iso: Windows Error Reporting (WER) dialog has been disabled.
        hyperv-iso: Disabling Internet Explorer ESC
        hyperv-iso: ===============================
        hyperv-iso: IE Enhanced Security Configuration (ESC) has been disabled.
        hyperv-iso: Disabling Internet Explorer Welcome Screen
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:     Hive: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: Name                           Property
        hyperv-iso: ----                           --------
        hyperv-iso: Main                           (default) : 1
        hyperv-iso: Disabled IE Welcome screen
        hyperv-iso: Disabling Antivirus
        hyperv-iso: ===================
        hyperv-iso: Disabling Windows Updates
        hyperv-iso: =========================
        hyperv-iso: Disabled Windows Update
        hyperv-iso: WinRM - allow * hosts
        hyperv-iso: =====================
        hyperv-iso: Client
        hyperv-iso:     NetworkDelayms = 5000
        hyperv-iso:     URLPrefix = wsman
        hyperv-iso:     AllowUnencrypted = false
        hyperv-iso:     Auth
        hyperv-iso:         Basic = true
        hyperv-iso:         Digest = true
        hyperv-iso:         Kerberos = true
        hyperv-iso:         Negotiate = true
        hyperv-iso:         Certificate = true
        hyperv-iso:         CredSSP = false
        hyperv-iso:     DefaultPorts
        hyperv-iso:         HTTP = 5985
        hyperv-iso:         HTTPS = 5986
        hyperv-iso:     TrustedHosts = *
        hyperv-iso:
        hyperv-iso: WinRM configured
        hyperv-iso: Allow RDP connections
        hyperv-iso: =====================
        hyperv-iso: RDP connections enabled
        hyperv-iso: Disabling new network location wizard
        hyperv-iso: =====================================
        hyperv-iso: The operation completed successfully.
        hyperv-iso:
        hyperv-iso: The operation completed successfully.
        hyperv-iso:
        hyperv-iso: Network location wizard disabled
        hyperv-iso: Switch time zone to UTC
        hyperv-iso: ========================
        hyperv-iso: Time zone switched
        hyperv-iso: Installing .NET 3.5
        hyperv-iso: ===================
        hyperv-iso:
        hyperv-iso: Success       : True
        hyperv-iso: RestartNeeded : No
        hyperv-iso: FeatureResult : {.NET Framework 3.5 (includes .NET 2.0 and 3.0), .NET Framework 3.5 Features}
        hyperv-iso: ExitCode      : Success
        hyperv-iso:
        hyperv-iso: .NET 3.5 installed
        hyperv-iso: Disable .NET NGEN service and Windows updates
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319
    ==> hyperv-iso: Restarting Machine
    ==> hyperv-iso: Waiting for machine to restart...
    ==> hyperv-iso: A system shutdown is in progress.(1115)
        hyperv-iso: APPVEYOR-2019 restarted.
    ==> hyperv-iso: #< CLIXML
    ==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
    ==> hyperv-iso: Machine successfully restarted, moving on
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/activate_avma.ps1
    ==> hyperv-iso: Uploading C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/path-utils.psm1 => C:/Users/appveyor/AppData/Local/Temp/path-utils.psm1
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/install_path_utils.ps1
        hyperv-iso: Installing Path-Utils
        hyperv-iso: =====================
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:     Directory: C:\Users\appveyor\Documents\WindowsPowerShell\Modules
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: Mode                LastWriteTime         Length Name
        hyperv-iso: ----                -------------         ------ ----
        hyperv-iso: d-----        1/23/2026  11:00 PM                path-utils
        hyperv-iso: Path-Utils installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/install_powershell_core.ps1
        hyperv-iso: Installing PowerShell Core 7.4.6
        hyperv-iso: ==========================
        hyperv-iso: Downloading...
        hyperv-iso: Installing...
        hyperv-iso: PowerShell 7.4.6
        hyperv-iso: PowerShell Core Installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/install_powershell_get.ps1
        hyperv-iso: Installing PowerShellGet
        hyperv-iso: ========================
        hyperv-iso:
        hyperv-iso: Name                           Version          Source           Summary
        hyperv-iso: ----                           -------          ------           -------
        hyperv-iso: nuget                          2.8.5.208        https://cdn.o... NuGet provider for the OneGet meta-package manager
        hyperv-iso: PowerShellGet installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/install_7zip.ps1
        hyperv-iso: Installing 7-Zip
        hyperv-iso: ================
        hyperv-iso: 7-Zip installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp16C8.tmp/scripts/Windows/install_chocolatey.ps1
        hyperv-iso: Installing Chocolatey
        hyperv-iso: =====================
        hyperv-iso: Installing Chocolatey...
        hyperv-iso: Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
        hyperv-iso: Getting latest version of the Chocolatey package for download.
        hyperv-iso: Not using proxy.
        hyperv-iso: Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0.
        hyperv-iso: Downloading https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0 to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
        hyperv-iso: Not using proxy.
        hyperv-iso: Extracting C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall
        hyperv-iso: Installing Chocolatey on the local machine
        hyperv-iso: The registry key for .Net 4.8 was not found or this is forced
        hyperv-iso: Downloading 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe' to 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - the installer is 100+ MBs, so this could take a while on a slow connection.
        hyperv-iso: Installing 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - this may take awhile with no output.
        hyperv-iso: WARNING: .NET Framework 4.8 was installed, but a reboot is required before using Chocolatey CLI.
        hyperv-iso: Creating ChocolateyInstall as an environment variable (targeting 'Machine')
        hyperv-iso:   Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
        hyperv-iso: WARNING: It's very likely you will need to close and reopen your shell
        hyperv-iso:   before you can use choco.
        hyperv-iso: Restricting write permissions to Administrators                                                             hyperv-iso: We are setting up the Chocolatey package repository.                                                        hyperv-iso: The packages themselves go to 'C:\ProgramData\chocolatey\lib'                                               hyperv-iso:   (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).                                                     hyperv-iso: A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'                                    hyperv-iso:   and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
        hyperv-iso:
        hyperv-iso: Creating Chocolatey CLI folders if they do not already exist.
        hyperv-iso:
        hyperv-iso: chocolatey.nupkg file not installed in lib.
        hyperv-iso:  Attempting to locate it from bootstrapper.
        hyperv-iso: PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
        hyperv-iso: WARNING: Not setting tab completion: Profile file does not exist at
        hyperv-iso: 'C:\Users\appveyor\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
        hyperv-iso: Chocolatey CLI (choco.exe) is nearly ready.
        hyperv-iso: You need to restart this machine prior to using choco.
        hyperv-iso: Ensuring Chocolatey commands are on the path
        hyperv-iso: Ensuring chocolatey.nupkg is in the lib folder
        hyperv-iso: 2.6.0
        hyperv-iso: Chocolatey v2.6.0
        hyperv-iso: .NET 4.8 is not installed or may need a reboot to complete installation.
        hyperv-iso: Please install .NET Framework 4.8 manually and reboot the system.
        hyperv-iso: Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'
        hyperv-iso: Chocolatey installed
    ==> hyperv-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
    ==> hyperv-iso: Disconnecting from vmconnect...
    ==> hyperv-iso: Clean up secondary dvd drives...
    ==> hyperv-iso: Clean up os dvd drive...
    ==> hyperv-iso: Unregistering and deleting virtual machine...
    ==> hyperv-iso: Deleting output directory...
    ==> hyperv-iso: Deleting build directory...
    Build 'hyperv-iso' errored: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
    
    ==> Some builds didn't complete successfully and had errors:
    --> hyperv-iso: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
    
    ==> Builds finished but no artifacts were created.
    WARNING: Packer build failed.
    

    It looks to me like init_server.ps1 has a hardcoded installation of .net3.5 prior to the installation of Chocolatey. It looks like ParseImageFeaturesAndCustomScripts only appends provisioners, so adding an optional feature isn’t going to be able to install anything prior to the core and undisableable Chocolatey install.
    I do see -ImageTemplate so I do have some hope that I can hack up something temporarily which will work. But it looks like you might need to add .net-4.8 to init_server.ps or pin your Chocolatey version to something that supports whatever .net-4.x comes preinstalled on Windows Server 2019.

  3. Support Staff 3 Posted by Owen McDonnell on 24 Jan, 2026 07:40 AM

    Owen McDonnell's Avatar

    Ok, we've updated the powershell module. Can you update it and run the original command again.

  4. 4 Posted by nbrink on 24 Jan, 2026 04:54 PM

    nbrink's Avatar

    Hello,
    I am trying that update. I can see the attempt to install .net-4.8.1, but that appears to fail. Unfortunately, install_dotnet_runtimes.ps1 has no error checking. So I had to look in the registry and observe the output from the Chocolatey installer to see that it had failed (but I also know from trying to install .net-4.8.1 manually that it fails on Windows 2019).

    As I look more closely at the build log, I can see that Chocolatey appears to actually detect the need to install .net-4.8 now and install it for you. However, Chocolatey writes a message saying that a machine reboot is necessary for the installation to complete.

    So, if you want to update the provisioning scripts to support this, you would need to add a step to install .net-4.8 (not .net-4.8.1) and a reboot step after that. Or you can pin the Chocolatey install to a version which supports .net-4.7.2 which is what appears to come preinstalled with Windows 2019.

    Checking AppVeyor API access...                                                                                                                                                                                                                 Checking if Hyper-V tools are installed...                                                                              
    
        Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d-----         1/24/2026   8:21 AM                iso-source
    
    
        Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp\iso
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    -a----         1/24/2026   8:21 AM        1245184 minimal-windows-server.iso
    
    Getting or creating virtual switch appveyor-NAT-Switch...
    
    Checking if Hashicorp Packer version 1.13.2 is installed...
    Downloading Packer version 1.13.2 to temporary folder...                                                                Using C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp2432.tmp\packer                                                                                                                                                                         Running Packer to create a basic build VM VHD...                                                                        WARNING: Add '-VhdPath' parameter with if you want to to skip Packer build and and reuse existing VHD.                  
    
    Packer progress:
    
    hyperv-iso output will be in this color.
    
    Warnings for build 'hyperv-iso':
    
    * For nested virtualization, when virtualization extension is enabled, mac spoofing should be allowed.                                                                                                                                          ==> hyperv-iso: Creating build directory...                                                                             ==> hyperv-iso: Retrieving ISO                                                                                          ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
    ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562
    ==> hyperv-iso: https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562 => C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso
    ==> hyperv-iso: Creating switch 'appveyor-NAT-Switch' if required...
    ==> hyperv-iso:     switch 'appveyor-NAT-Switch' already exists. Will not delete on cleanup...
    ==> hyperv-iso: Creating virtual machine...
    ==> hyperv-iso: Enabling Integration Service...
    ==> hyperv-iso: Setting boot drive to os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
    ==> hyperv-iso: Mounting os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
    ==> hyperv-iso: Skipping mounting Integration Services Setup Disk...
    ==> hyperv-iso: Mounting secondary DVD images...
    ==> hyperv-iso: Mounting secondary dvd drive C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/iso/minimal-windows-server.iso ...
    ==> hyperv-iso: Configuring vlan...
    ==> hyperv-iso: Determine Host IP for HyperV machine...
    ==> hyperv-iso: Host IP for the HyperV machine: 10.118.232.1
    ==> hyperv-iso: Attempting to connect with vmconnect...
    ==> hyperv-iso: Starting the virtual machine...
    ==> hyperv-iso: Waiting 1s for boot...
    ==> hyperv-iso: Typing the boot command...
    ==> hyperv-iso: Waiting for WinRM to become available...
        hyperv-iso: WinRM connected.
    ==> hyperv-iso: #< CLIXML
    ==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
    ==> hyperv-iso: Connected to WinRM!
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/create_appveyor_user.ps1
        hyperv-iso: Creating AppVeyor user
        hyperv-iso: ======================
    ==> hyperv-iso: The account already exists.
    ==> hyperv-iso:
    ==> hyperv-iso: More help is available by typing NET HELPMSG 2224.
    ==> hyperv-iso:
        hyperv-iso: Auth
        hyperv-iso:     Basic = true
        hyperv-iso:     Kerberos = true
        hyperv-iso:     Negotiate = true
        hyperv-iso:     Certificate = false
    ==> hyperv-iso: System error 1378 has occurred.
        hyperv-iso:     CredSSP = false
        hyperv-iso:     CbtHardeningLevel = Relaxed
        hyperv-iso:
        hyperv-iso: User created
    ==> hyperv-iso:
    ==> hyperv-iso: The specified account name is already a member of the group.
    ==> hyperv-iso:
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\powershell-provisioner930151995
        hyperv-iso: Current user: appveyor-2019\appveyor
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/init_server.ps1
        hyperv-iso: Disabling UAC
        hyperv-iso: =============
        hyperv-iso: User Access Control (UAC) has been disabled.
        hyperv-iso: Changing PS execution policy to Unrestricted
        hyperv-iso: ============================================
        hyperv-iso: PS policy updated
        hyperv-iso: Disabling Server Manager auto-start
        hyperv-iso: ===================================
        hyperv-iso: Disabled Server Manager at logon for all users
        hyperv-iso: Disabled Server Manager for current user
        hyperv-iso: Disabling Windows Error Reporting (WER)
        hyperv-iso: =======================================
        hyperv-iso: Windows Error Reporting (WER) dialog has been disabled.
        hyperv-iso: Disabling Internet Explorer ESC
        hyperv-iso: ===============================
        hyperv-iso: IE Enhanced Security Configuration (ESC) has been disabled.
        hyperv-iso: Disabling Internet Explorer Welcome Screen
        hyperv-iso: ==========================================
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:     Hive: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: Name                           Property
        hyperv-iso: ----                           --------
        hyperv-iso: Main                           (default) : 1
        hyperv-iso: Disabled IE Welcome screen
        hyperv-iso: Disabling Antivirus
        hyperv-iso: ===================
        hyperv-iso: Disabling Windows Updates
        hyperv-iso: =========================
        hyperv-iso: Disabled Windows Update
        hyperv-iso: WinRM - allow * hosts
        hyperv-iso: =====================
        hyperv-iso: Client
        hyperv-iso:     NetworkDelayms = 5000
        hyperv-iso:     URLPrefix = wsman
        hyperv-iso:     AllowUnencrypted = false
        hyperv-iso:     Auth
        hyperv-iso:         Basic = true
        hyperv-iso:         Digest = true
        hyperv-iso:         Kerberos = true
        hyperv-iso:         Negotiate = true
        hyperv-iso:         Certificate = true
        hyperv-iso:         CredSSP = false
        hyperv-iso:     DefaultPorts
        hyperv-iso:         HTTP = 5985
        hyperv-iso:         HTTPS = 5986
        hyperv-iso:     TrustedHosts = *
        hyperv-iso:
        hyperv-iso: WinRM configured
        hyperv-iso: Allow RDP connections
        hyperv-iso: =====================
        hyperv-iso: RDP connections enabled
        hyperv-iso: Disabling new network location wizard
        hyperv-iso: =====================================
        hyperv-iso: The operation completed successfully.
        hyperv-iso:
        hyperv-iso: The operation completed successfully.
        hyperv-iso:
        hyperv-iso: Network location wizard disabled
        hyperv-iso: Switch time zone to UTC
        hyperv-iso: ========================
        hyperv-iso: Time zone switched
        hyperv-iso: Installing .NET 3.5
        hyperv-iso: ===================
        hyperv-iso:
        hyperv-iso: Success       : True
        hyperv-iso: RestartNeeded : No
        hyperv-iso: FeatureResult : {.NET Framework 3.5 (includes .NET 2.0 and 3.0), .NET Framework 3.5 Features}
        hyperv-iso: ExitCode      : Success
        hyperv-iso:
        hyperv-iso: .NET 3.5 installed
        hyperv-iso: Disable .NET NGEN service and Windows updates
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319
    ==> hyperv-iso: Restarting Machine
    ==> hyperv-iso: Waiting for machine to restart...
    ==> hyperv-iso: A system shutdown is in progress.(1115)
        hyperv-iso: APPVEYOR-2019 restarted.
    ==> hyperv-iso: #< CLIXML
    ==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
    ==> hyperv-iso: Machine successfully restarted, moving on
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/activate_avma.ps1
    ==> hyperv-iso: Uploading C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/path-utils.psm1 => C:/Users/appveyor/AppData/Local/Temp/path-utils.psm1
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/install_path_utils.ps1
        hyperv-iso: Installing Path-Utils
        hyperv-iso: =====================
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:     Directory: C:\Users\appveyor\Documents\WindowsPowerShell\Modules
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: Mode                LastWriteTime         Length Name
        hyperv-iso: ----                -------------         ------ ----
        hyperv-iso: d-----        1/24/2026   4:38 PM                path-utils
        hyperv-iso: Path-Utils installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/install_dotnet_runtimes.ps1
        hyperv-iso: .NET Framework 4.8.1 runtime...
        hyperv-iso: Downloading...
        hyperv-iso: Installing...
        hyperv-iso: Installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/install_powershell_core.ps1
        hyperv-iso: Installing PowerShell Core 7.5.2
        hyperv-iso: ==========================
        hyperv-iso: Downloading...
        hyperv-iso: Installing...
        hyperv-iso: PowerShell 7.5.2
        hyperv-iso: PowerShell Core Installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/install_powershell_get.ps1
        hyperv-iso: Installing PowerShellGet
        hyperv-iso: ========================
        hyperv-iso:
        hyperv-iso: Name                           Version          Source           Summary
        hyperv-iso: ----                           -------          ------           -------
        hyperv-iso: nuget                          2.8.5.208        https://cdn.o... NuGet provider for the OneGet meta-package manager
        hyperv-iso: PowerShellGet installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/install_7zip.ps1
        hyperv-iso: Installing 7-Zip
        hyperv-iso: ================
        hyperv-iso: 7-Zip installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp1E36.tmp/scripts/Windows/install_chocolatey.ps1
        hyperv-iso: Installing Chocolatey
        hyperv-iso: =====================
        hyperv-iso: Installing Chocolatey...
        hyperv-iso: Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
        hyperv-iso: Getting latest version of the Chocolatey package for download.
        hyperv-iso: Not using proxy.
        hyperv-iso: Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0.
        hyperv-iso: Downloading https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0 to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
        hyperv-iso: Not using proxy.
        hyperv-iso: Extracting C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall
        hyperv-iso: Installing Chocolatey on the local machine
        hyperv-iso: The registry key for .Net 4.8 was not found or this is forced
        hyperv-iso: Downloading 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe' to 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - the installer is 100+ MBs, so this could take a while on a slow connection.
        hyperv-iso: Installing 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - this may take awhile with no output.
        hyperv-iso: WARNING: .NET Framework 4.8 was installed, but a reboot is required before using Chocolatey CLI.
        hyperv-iso: Creating ChocolateyInstall as an environment variable (targeting 'Machine')
        hyperv-iso:   Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
        hyperv-iso: WARNING: It's very likely you will need to close and reopen your shell
        hyperv-iso:   before you can use choco.
        hyperv-iso: Restricting write permissions to Administrators                                                             hyperv-iso: We are setting up the Chocolatey package repository.                                                        hyperv-iso: The packages themselves go to 'C:\ProgramData\chocolatey\lib'                                               hyperv-iso:   (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).                                                     hyperv-iso: A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'                                    hyperv-iso:   and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
        hyperv-iso:
        hyperv-iso: Creating Chocolatey CLI folders if they do not already exist.
        hyperv-iso:
        hyperv-iso: chocolatey.nupkg file not installed in lib.
        hyperv-iso:  Attempting to locate it from bootstrapper.
        hyperv-iso: PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
        hyperv-iso: WARNING: Not setting tab completion: Profile file does not exist at
        hyperv-iso: 'C:\Users\appveyor\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
        hyperv-iso: Chocolatey CLI (choco.exe) is nearly ready.
        hyperv-iso: You need to restart this machine prior to using choco.
        hyperv-iso: Ensuring Chocolatey commands are on the path
        hyperv-iso: Ensuring chocolatey.nupkg is in the lib folder
        hyperv-iso: 2.6.0
        hyperv-iso: Chocolatey v2.6.0
        hyperv-iso: .NET 4.8 is not installed or may need a reboot to complete installation.
        hyperv-iso: Please install .NET Framework 4.8 manually and reboot the system.
        hyperv-iso: Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'
        hyperv-iso: Chocolatey installed
    ==> hyperv-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
    ==> hyperv-iso: Disconnecting from vmconnect...
    ==> hyperv-iso: Clean up secondary dvd drives...
    ==> hyperv-iso: Clean up os dvd drive...
    ==> hyperv-iso: Unregistering and deleting virtual machine...
    ==> hyperv-iso: Deleting output directory...
    ==> hyperv-iso: Deleting build directory...
    Build 'hyperv-iso' errored: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
    
    ==> Some builds didn't complete successfully and had errors:
    --> hyperv-iso: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
    
    ==> Builds finished but no artifacts were created.
    WARNING: Packer build failed.
    
  5. 5 Posted by nbrink on 24 Jan, 2026 04:59 PM

    nbrink's Avatar

    Or maybe another option would be to make Chocolatey optional? I would prefer not to even have that in my build image if possible…

  6. Support Staff 6 Posted by Owen McDonnell on 24 Jan, 2026 07:24 PM

    Owen McDonnell's Avatar

    There is another parameter to the Connect-AppVeyorToHyperV.ps1 script, -PackerCustomArgs, so you could try this to pin chocolatey version.

    Connect-AppVeyorToHyperV -AppVeyorUrl https://ci.appveyor.com -ApiToken «redacted» -CpuCores 6 -RamMb 4096 -ImageName "vs17 SQLEXPRESS12" -ImageOs "Windows" -ImageTemplate "minimal-windows-server.json" -ImageFeatures "dotnet_devpacks,dotnet_core_sdks,nodejs_latest,vs2022" -ImageCustomScript "" -ImageCustomScriptAfterReboot "" -PackerCustomArgs "-var 'chocolateyVersion=1.4'"
    
  7. 7 Posted by nbrink on 27 Jan, 2026 03:08 AM

    nbrink's Avatar

    Hello Owen,
    The -var option defines a packer variable. That does not define an environment variable for the scripts run by packer. To do that, the template has to specify that the environment variable should be set prior to running the script explicitly. That is pretty easy for a punch through like this.
    Anyway, with that last command, I get this output:

    PS C:\Windows\System32> Connect-AppVeyorToHyperV -SkipDisclaimer -AppVeyorUrl https://ci.appveyor.com -ApiToken «redacted» -CpuCores 6 -RamMb 4096 -ImageName "vs17 SQLEXPRESS12" -ImageOs "Windows" -PackerCustomArgs "-var 'chocolateyVersion=1.4'" -ImageTemplate "minimal-windows-server.json" -ImageFeatures "dotnet_devpacks,dotnet_core_sdks,nodejs_latest,vs2022" -ImageCustomScript "" -ImageCustomScriptAfterReboot ""                                                                                                                                  Checking AppVeyor API access...                                                                                                                                                                                                                 Checking if Hyper-V tools are installed...                                                                              
    
        Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    d-----         1/25/2026   9:32 PM                iso-source
    
    
        Directory: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp\iso
    
    
    Mode                 LastWriteTime         Length Name
    ----                 -------------         ------ ----
    -a----         1/25/2026   9:32 PM        1245184 minimal-windows-server.iso
    
    Getting or creating virtual switch appveyor-NAT-Switch...
    
    Checking if Hashicorp Packer version 1.13.2 is installed...
    Downloading Packer version 1.13.2 to temporary folder...                                                                Using C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp990C.tmp\packer                                                                                                                                                                         Running Packer to create a basic build VM VHD...                                                                        WARNING: Add '-VhdPath' parameter with if you want to to skip Packer build and and reuse existing VHD.                  
    
    Packer progress:
    
    hyperv-iso output will be in this color.
    
    Warnings for build 'hyperv-iso':
    
    * For nested virtualization, when virtualization extension is enabled, mac spoofing should be allowed.                                                                                                                                          ==> hyperv-iso: Creating build directory...                                                                             ==> hyperv-iso: Retrieving ISO                                                                                          ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso
    ==> hyperv-iso: Trying https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562
    ==> hyperv-iso: https://software-download.microsoft.com/download/sg/17763.379.190312-0539.rs5_release_svc_refresh_SERVER_EVAL_x64FRE_en-us.iso?checksum=sha256%3A221F9ACBC727297A56674A0F1722B8AC7B6E840B4E1FFBDD538A9ED0DA823562 => C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso
    ==> hyperv-iso: Creating switch 'appveyor-NAT-Switch' if required...
    ==> hyperv-iso:     switch 'appveyor-NAT-Switch' already exists. Will not delete on cleanup...
    ==> hyperv-iso: Creating virtual machine...
    ==> hyperv-iso: Enabling Integration Service...
    ==> hyperv-iso: Setting boot drive to os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
    ==> hyperv-iso: Mounting os dvd drive C:\Windows\System32\packer_cache\cd77cf7d0bac0a4c63bf5672646721c114b4732f.iso ...
    ==> hyperv-iso: Skipping mounting Integration Services Setup Disk...
    ==> hyperv-iso: Mounting secondary DVD images...
    ==> hyperv-iso: Mounting secondary dvd drive C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/iso/minimal-windows-server.iso ...
    ==> hyperv-iso: Configuring vlan...
    ==> hyperv-iso: Determine Host IP for HyperV machine...
    ==> hyperv-iso: Host IP for the HyperV machine: 10.118.232.1
    ==> hyperv-iso: Attempting to connect with vmconnect...
    ==> hyperv-iso: Starting the virtual machine...
    ==> hyperv-iso: Waiting 1s for boot...
    ==> hyperv-iso: Typing the boot command...
    ==> hyperv-iso: Waiting for WinRM to become available...
    ==> hyperv-iso: #< CLIXML
        hyperv-iso: WinRM connected.
    ==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj><Obj S="progress" RefId="1"><TNRef RefId="0" /><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
    ==> hyperv-iso: Connected to WinRM!
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/create_appveyor_user.ps1
        hyperv-iso: Creating AppVeyor user
        hyperv-iso: ======================
        hyperv-iso: Auth
    ==> hyperv-iso: The account already exists.
    ==> hyperv-iso:
        hyperv-iso:     Basic = true
        hyperv-iso:     Kerberos = true
        hyperv-iso:     Negotiate = true
        hyperv-iso:     Certificate = false
        hyperv-iso:     CredSSP = false
        hyperv-iso:     CbtHardeningLevel = Relaxed
        hyperv-iso:
        hyperv-iso: User created
    ==> hyperv-iso: More help is available by typing NET HELPMSG 2224.
    ==> hyperv-iso:
    ==> hyperv-iso: System error 1378 has occurred.
    ==> hyperv-iso:
    ==> hyperv-iso: The specified account name is already a member of the group.
    ==> hyperv-iso:
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\powershell-provisioner485353083
        hyperv-iso: Current user: appveyor-2019\appveyor
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/init_server.ps1
        hyperv-iso: Disabling UAC
        hyperv-iso: =============
        hyperv-iso: User Access Control (UAC) has been disabled.
        hyperv-iso: Changing PS execution policy to Unrestricted
        hyperv-iso: ============================================
        hyperv-iso: PS policy updated
        hyperv-iso: Disabling Server Manager auto-start
        hyperv-iso: ===================================
        hyperv-iso: Disabled Server Manager at logon for all users
        hyperv-iso: Disabled Server Manager for current user
        hyperv-iso: Disabling Windows Error Reporting (WER)
        hyperv-iso: =======================================
        hyperv-iso: Windows Error Reporting (WER) dialog has been disabled.
        hyperv-iso: Disabling Internet Explorer ESC
        hyperv-iso: ===============================
        hyperv-iso: IE Enhanced Security Configuration (ESC) has been disabled.
        hyperv-iso: Disabling Internet Explorer Welcome Screen
        hyperv-iso: ==========================================
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:     Hive: HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Internet Explorer
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: Name                           Property
        hyperv-iso: ----                           --------
        hyperv-iso: Main                           (default) : 1
        hyperv-iso: Disabled IE Welcome screen
        hyperv-iso: Disabling Antivirus
        hyperv-iso: ===================
        hyperv-iso: Disabling Windows Updates
        hyperv-iso: =========================
        hyperv-iso: Disabled Windows Update
        hyperv-iso: WinRM - allow * hosts
        hyperv-iso: =====================
        hyperv-iso: Client
        hyperv-iso:     NetworkDelayms = 5000
        hyperv-iso:     URLPrefix = wsman
        hyperv-iso:     AllowUnencrypted = false
        hyperv-iso:     Auth
        hyperv-iso:         Basic = true
        hyperv-iso:         Digest = true
        hyperv-iso:         Kerberos = true
        hyperv-iso:         Negotiate = true
        hyperv-iso:         Certificate = true
        hyperv-iso:         CredSSP = false
        hyperv-iso:     DefaultPorts
        hyperv-iso:         HTTP = 5985
        hyperv-iso:         HTTPS = 5986
        hyperv-iso:     TrustedHosts = *
        hyperv-iso:
        hyperv-iso: WinRM configured
        hyperv-iso: Allow RDP connections
        hyperv-iso: =====================
        hyperv-iso: RDP connections enabled
        hyperv-iso: Disabling new network location wizard
        hyperv-iso: =====================================
        hyperv-iso: The operation completed successfully.
        hyperv-iso:
        hyperv-iso: The operation completed successfully.
        hyperv-iso:
        hyperv-iso: Network location wizard disabled
        hyperv-iso: Switch time zone to UTC
        hyperv-iso: ========================
        hyperv-iso: Time zone switched
        hyperv-iso: Installing .NET 3.5
        hyperv-iso: ===================
        hyperv-iso:
        hyperv-iso: Success       : True
        hyperv-iso: RestartNeeded : No
        hyperv-iso: FeatureResult : {.NET Framework 3.5 (includes .NET 2.0 and 3.0), .NET Framework 3.5 Features}
        hyperv-iso: ExitCode      : Success
        hyperv-iso:
        hyperv-iso: .NET 3.5 installed
        hyperv-iso: Disable .NET NGEN service and Windows updates
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64 Critical
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 64
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319 Critical
        hyperv-iso: \Microsoft\Windows\.NET Framework\.NET Framework NGEN v4.0.30319
    ==> hyperv-iso: Restarting Machine
    ==> hyperv-iso: Waiting for machine to restart...
    ==> hyperv-iso: A system shutdown is in progress.(1115)
    ==> hyperv-iso: #< CLIXML
        hyperv-iso: APPVEYOR-2019 restarted.
    ==> hyperv-iso: <Objs Version="1.1.0.1" xmlns="http://schemas.microsoft.com/powershell/2004/04"><Obj S="progress" RefId="0"><TN RefId="0"><T>System.Management.Automation.PSCustomObject</T><T>System.Object</T></TN><MS><I64 N="SourceId">1</I64><PR N="Record"><AV>Preparing modules for first use.</AV><AI>0</AI><Nil /><PI>-1</PI><PC>-1</PC><T>Completed</T><SR>-1</SR><SD> </SD></PR></MS></Obj></Objs>
    ==> hyperv-iso: Machine successfully restarted, moving on
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/activate_avma.ps1
    ==> hyperv-iso: Uploading C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/path-utils.psm1 => C:/Users/appveyor/AppData/Local/Temp/path-utils.psm1
    ==> hyperv-iso: Provisioning with Powershell...
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/install_path_utils.ps1
        hyperv-iso: Installing Path-Utils
        hyperv-iso: =====================
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:     Directory: C:\Users\appveyor\Documents\WindowsPowerShell\Modules
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: Mode                LastWriteTime         Length Name
        hyperv-iso: ----                -------------         ------ ----
        hyperv-iso: d-----        1/26/2026   5:49 AM                path-utils
        hyperv-iso: Path-Utils installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/install_dotnet_runtimes.ps1
        hyperv-iso: .NET Framework 4.8.1 runtime...
        hyperv-iso: Downloading...
        hyperv-iso: Installing...
        hyperv-iso: Installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/install_powershell_core.ps1
        hyperv-iso: Installing PowerShell Core 7.5.2
        hyperv-iso: ==========================
        hyperv-iso: Downloading...
        hyperv-iso: Installing...
        hyperv-iso: PowerShell 7.5.2
        hyperv-iso: PowerShell Core Installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/install_powershell_get.ps1
        hyperv-iso: Installing PowerShellGet
        hyperv-iso: ========================
        hyperv-iso:
        hyperv-iso: Name                           Version          Source           Summary
        hyperv-iso: ----                           -------          ------           -------
        hyperv-iso: nuget                          2.8.5.208        https://cdn.o... NuGet provider for the OneGet meta-package manager
        hyperv-iso: PowerShellGet installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/install_7zip.ps1
        hyperv-iso: Installing 7-Zip
        hyperv-iso: ================
        hyperv-iso: 7-Zip installed
    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp938C.tmp/scripts/Windows/install_chocolatey.ps1
        hyperv-iso: Installing Chocolatey
        hyperv-iso: =====================
        hyperv-iso: Installing Chocolatey...
        hyperv-iso: Forcing web requests to allow TLS v1.2 (Required for requests to Chocolatey.org)
        hyperv-iso: Getting latest version of the Chocolatey package for download.
        hyperv-iso: Not using proxy.
        hyperv-iso: Getting Chocolatey from https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0.
        hyperv-iso: Downloading https://community.chocolatey.org/api/v2/package/chocolatey/2.6.0 to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip
        hyperv-iso: Not using proxy.
        hyperv-iso: Extracting C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall\chocolatey.zip to C:\Users\appveyor\AppData\Local\Temp\chocolatey\chocoInstall
        hyperv-iso: Installing Chocolatey on the local machine
        hyperv-iso: The registry key for .Net 4.8 was not found or this is forced
        hyperv-iso: Downloading 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe' to 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - the installer is 100+ MBs, so this could take a while on a slow connection.
        hyperv-iso: Installing 'C:\Users\appveyor\AppData\Local\Temp\ndp48-x86-x64-allos-enu.exe' - this may take awhile with no output.
        hyperv-iso: WARNING: .NET Framework 4.8 was installed, but a reboot is required before using Chocolatey CLI.
        hyperv-iso: Creating ChocolateyInstall as an environment variable (targeting 'Machine')
        hyperv-iso:   Setting ChocolateyInstall to 'C:\ProgramData\chocolatey'
        hyperv-iso: WARNING: It's very likely you will need to close and reopen your shell
        hyperv-iso:   before you can use choco.
        hyperv-iso: Restricting write permissions to Administrators                                                             hyperv-iso: We are setting up the Chocolatey package repository.                                                        hyperv-iso: The packages themselves go to 'C:\ProgramData\chocolatey\lib'                                               hyperv-iso:   (i.e. C:\ProgramData\chocolatey\lib\yourPackageName).                                                     hyperv-iso: A shim file for the command line goes to 'C:\ProgramData\chocolatey\bin'                                    hyperv-iso:   and points to an executable in 'C:\ProgramData\chocolatey\lib\yourPackageName'.
        hyperv-iso:
        hyperv-iso: Creating Chocolatey CLI folders if they do not already exist.
        hyperv-iso:
        hyperv-iso: chocolatey.nupkg file not installed in lib.
        hyperv-iso:  Attempting to locate it from bootstrapper.
        hyperv-iso: PATH environment variable does not have C:\ProgramData\chocolatey\bin in it. Adding...
        hyperv-iso: WARNING: Not setting tab completion: Profile file does not exist at
        hyperv-iso: 'C:\Users\appveyor\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1'.
        hyperv-iso: Chocolatey CLI (choco.exe) is nearly ready.
        hyperv-iso: You need to restart this machine prior to using choco.
        hyperv-iso: Ensuring Chocolatey commands are on the path
        hyperv-iso: Ensuring chocolatey.nupkg is in the lib folder
        hyperv-iso: 2.6.0
        hyperv-iso: Chocolatey v2.6.0
        hyperv-iso: .NET 4.8 is not installed or may need a reboot to complete installation.
        hyperv-iso: Please install .NET Framework 4.8 manually and reboot the system.
        hyperv-iso: Download at 'https://download.visualstudio.microsoft.com/download/pr/2d6bb6b2-226a-4baa-bdec-798822606ff1/8494001c276a4b96804cde7829c04d7f/ndp48-x86-x64-allos-enu.exe'
        hyperv-iso: Chocolatey installed
    ==> hyperv-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
    ==> hyperv-iso: Disconnecting from vmconnect...
    ==> hyperv-iso: Clean up secondary dvd drives...
    ==> hyperv-iso: Clean up os dvd drive...
    ==> hyperv-iso: Unregistering and deleting virtual machine...
    ==> hyperv-iso: Deleting output directory...
    ==> hyperv-iso: Deleting build directory...
    Build 'hyperv-iso' errored: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
    
    ==> Some builds didn't complete successfully and had errors:
    --> hyperv-iso: Script exited with non-zero exit status: 1.Allowed exit codes are: [0]
    
    ==> Builds finished but no artifacts were created.
    WARNING: Packer build failed.
    

    If I make the following changes:

    diff --git a/minimal-windows-server.json b/minimal-windows-server.json
    index 0183aab..b386ce1 100644
    --- a/minimal-windows-server.json
    +++ b/minimal-windows-server.json
    @@ -203,6 +203,9 @@
         {
           "elevated_password": "{{user install_password}}",
           "elevated_user": "{{user install_user}}",
    +      "environment_vars": [
    +        "chocolateyVersion={{user chocolateyVersion}}"
    +      ],
           "scripts": [
             "{{ template_dir }}/scripts/Windows/install_path_utils.ps1",
             "{{ template_dir }}/scripts/Windows/install_powershell_core.ps1",
    

    And if I adjust my invocation to have not -PackerCustomArgs "-var 'chocolateyVersion=1.4.4'" but to instead have -PackerCustomArgs '-var "chocolateyVersion=1.4.4"', then I get Chocolatey-1.4.4 which supports .net-4.7.2.

    Anyway, I would like to suggest that you fix your master branch of the build-images repository to default to Chocolatey-1.4.4 since the master branch of the repository only targets Windows Server 2019 which is only supported by Chocolatey-1.4.4 or otherwise requires netfx-4.8 to be installed and the VM rebooted prior to installing Chocolatey.

    Anyway, after working around that, my next failure is:

    ==> hyperv-iso: Provisioning with powershell script: C:\Users\binki\AppData\Local\Temp\AppVeyorBYOC\tmp3B7E.tmp/scripts/Windows/install_appveyor_build_agent_core.ps1
        hyperv-iso: Installing AppVeyor Build Agent Core
        hyperv-iso: ====================================
        hyperv-iso: Installing Build Agent Core version 7.0.2883 to 'C:\Program Files\AppVeyor\BuildAgent'
        hyperv-iso: Downloading...
        hyperv-iso: Exception calling "DownloadFile" with "2" argument(s): "The remote server returned an error: (404) Not Found."
        hyperv-iso: At C:\Windows\Temp\script-697827dd-540c-3065-3e9f-498b0edfbdc0.ps1:26 char:1
        hyperv-iso: + (New-Object Net.WebClient).DownloadFile("https://appveyordownloads.bl ...
        hyperv-iso: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        hyperv-iso:     + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException                               hyperv-iso:     + FullyQualifiedErrorId : WebException                                                                  hyperv-iso:                                                                                                             hyperv-iso: Unpacking...                                                                                                hyperv-iso:                                                                                                             hyperv-iso: ERROR: The system cannot find the file specified.
        hyperv-iso: C:\Users\appveyor\AppData\Local\Temp\appveyor-build-agent.zip
        hyperv-iso:
        hyperv-iso:
        hyperv-iso:
        hyperv-iso: System ERROR:
        hyperv-iso: The system cannot find the file specified.
        hyperv-iso: Remove-Item : Cannot find path 'C:\Users\appveyor\AppData\Local\Temp\appveyor-build-agent.zip' because it does not
        hyperv-iso: exist.
        hyperv-iso: At C:\Windows\Temp\script-697827dd-540c-3065-3e9f-498b0edfbdc0.ps1:31 char:1
        hyperv-iso: + Remove-Item $zipPath -Force
        hyperv-iso: + ~~~~~~~~~~~~~~~~~~~~~~~~~~~
        hyperv-iso:     + CategoryInfo          : ObjectNotFound: (C:\Users\appvey...build-agent.zip:String) [Remove-Item], ItemNotFoundEx
        hyperv-iso:    ception
        hyperv-iso:     + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.RemoveItemCommand
        hyperv-iso:
        hyperv-iso: Agent mode: HyperV
        hyperv-iso: AppVeyor Build Agent installed
    ==> hyperv-iso: Provisioning step had errors: Running the cleanup provisioner, if present...
    ==> hyperv-iso: Disconnecting from vmconnect...
    ==> hyperv-iso: Clean up secondary dvd drives...
    ==> hyperv-iso: Clean up os dvd drive...
    ==> hyperv-iso: Unregistering and deleting virtual machine...
    ==> hyperv-iso: Deleting output directory...
    ==> hyperv-iso: Deleting build directory...
    Build 'hyperv-iso' errored: Script exited with non-zero exit status: 2.Allowed exit codes are: [0]
    
    ==> Some builds didn't complete successfully and had errors:
    --> hyperv-iso: Script exited with non-zero exit status: 2.Allowed exit codes are: [0]
    
    ==> Builds finished but no artifacts were created.
    WARNING: Packer build failed.
    

    I assume the master branch has an outdated link to the AppVeyor build agent?

  8. 8 Posted by nbrink on 27 Jan, 2026 04:25 PM

    nbrink's Avatar

    I opened a PR which installs netfx-4.8 prior to attempting to install Chocolatey and succeeds at getting Chocolatey installed at https://github.com/appveyor/build-images/pull/174.

    Can you get this in and also fix the app veyor agent URL and get that rolled into a new powershell module?

    Thanks!

  9. Support Staff 9 Posted by Owen McDonnell on 30 Jan, 2026 04:43 PM

    Owen McDonnell's Avatar

    A new powershell module has been published with those changes.

  10. Owen McDonnell closed this discussion on 30 Jan, 2026 04:43 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac