BYOC Hyper-V host system failing to create VM, “Error running PowerShell command”

nbrink's Avatar

nbrink

29 Jan, 2026 05:23 AM

After finally getting a build image (see this discussion), the AppVeyor host agent appears to have installed itself and be running. However, when I send jobs to it, it fails to start any of them. I see various logs from AppVeyor host agent including these errors:

First error:

Category: Appveyor.HostAgent.HyperV.WorkerCloud
EventId: 0


[worker-2306-002] Cannot create worker VM

Second error:

Category: Appveyor.HostAgent.HyperV.WorkerCloud
EventId: 0


[worker-2306-002] System.Exception: Error running PowerShell command at Appveyor.BuildWorkers.HyperV.HyperVUtility.ExecutePowerShell(String args) at Appveyor.BuildWorkers.HyperV.HyperVUtility.CreateVirtualMachine(String vmName, Int32 generation, Int32 ramMB, Int32 cpuCount, Boolean nestedVirtualizationEnabled, String imagePath, Int32 diskSizeGB, Boolean vmqEnabled, Int32 networkVlan, String networkSwitchName, Boolean macAddressSpoofingEnabled, String hardDiskDirectory, Int32 maxIOPS, Int32 maxRamMB, CancellationToken cancellationToken) at Appveyor.HostAgent.HyperV.Worker.CreateWorker()

The host system is Windows 11 25H2 (build 26200.7623).

I wanted to see BYOC function before investing time in creating a packer image appropriate for my software..

Is this a known issue? Is there anything I can do to work around it or any other information you need?

Thanks.

  1. Support Staff 1 Posted by Owen McDonnell on 04 Feb, 2026 11:15 PM

    Owen McDonnell's Avatar

    I'm on a Windows 11 24H2 machine but can't recreate this problem.
    Can you share your build cloud settings? Double check that the path to your build image is correct.

  2. 2 Posted by nbrink on 14 Feb, 2026 06:05 PM

    nbrink's Avatar

    Windows 11 24H2 is different from my environment. I am using Windows 11 25H2. That might explain why it works for you. PowerShell 2.0 is deprecated and no longer included in Windows 11 25H2. Could you test on a fresh install of Windows 11 25H2?
    I found that I could work around the issue by applying the temporary mitigation documented at PowerShell 2.0 removal. However, Microsoft notes that PowerShell 2.0 has long since been deprecated and is not supported. Can you please update your scripts to not require PowerShell 2.0? You can do this by, as I suggested above, starting with a fresh installation of the latest Windows build (11 25H2 or Windows Server 2025 September 2025 update).
    Thanks!

  3. Support Staff 3 Posted by Owen McDonnell on 17 Feb, 2026 11:19 PM

    Owen McDonnell's Avatar

    I updated to latest windows 11 25H2 build 26200.7840, and I hit the same error you described but a simple reboot sorted it out.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

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