Skip to content

Reuse Use Case - Separate Unattended #12

@drstonephd

Description

@drstonephd

Once I get an set of disks built for a VM, I will want to copy them for each new VM. Because I do not have all the info (e.g., computer name and OU), perhaps the injection of the unattended file should be separate. Then the unattended can be applied to a copy of a VHDX. Are there other things that should be separate?

Also, from what I've read online, it appears that both x86 and amd64 sections for the some thing will both run on an amd64 system if both are present. The WinPE pass needs to be x86 or amd64, depending upon what WinPE is using. The other passes are only in the x86 or amd64 of the OS deployed? Can the WinPE and OS architectures be detected from the image?

Expected Behavior

The unattended file generated should have one section per architecture. The architecture of the section needs to be appropriate for both the WinPE and OS deployed. The unattended file will be specific to each deployment, so it needs to be applied (or re-applied) after the base image is copied.

Current Behavior

The unattended can have both or have x86 when deploying to amd64. If I copy the VHDX files for a new VM, I will need to create a new function to call New-UnattendedXMl and replace the existing unattended file. Or I will need to manually mount the VHDX and update the unattended file.

Possible Solution

Use only amd64 in the template. Change the attribute to x86 in WinPE pass components if WinPe is x86. Change the other components proc attribute to x86 is the OS is 32 bit. In those rare cases that the x86 and amd64 components for the same thing are different, then include both in the template and later remove any that do not apply.

The code should be x86 and amd64 agnostic unless there is a real difference in how the xml is constructed. The x86/amd64 attribute can be altered as needed for those that are otherwise identical.

Steps to Reproduce (for bugs)

Context

I'm testing with a windows server 2019 image. I changed all "x86" entries in the New-UnattendedXML template to "amd64" and removed duplicates. Then I updated the code to insure there was no duplicate processing or specific test for x86. Works for the amd64 only case.

Your Environment

  • Module version used:
  • Operating System and PowerShell version:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions