install wim via Powershellscript RRS feed

  • Question

  • Hello,

    I'm trying to automate the installation of Windows 10 on laptops. I can't use SCCM, because the company doesn't want to make the laptops manageable via network, so I resorted to making a custom WinPE USB stick.  I created 2 partitions on this stick, one for WinPE and one for the location of the 'to-be-installed'-image and the Mount folder for the 'to-be-installed'-image. I want to automate the installation by using a Powershell-script. I already added Powershell support to the "boot.wim"-image I created for WinPE.

    The problem I'm facing now is that, when I want to mount the 'to-be-installed'-image to the mount folder in the other partition of the USB stick, I get the following message: "The drive of the specified mount path is not supported.  Please mount to a volume on a fixed drive."

    Does anybody know if it is possible to mount to the "mount"-folder on the USB stick, or does anybody know some other options I can use to automate the installation of an image?

    Thanks in advance. Just to be sure, below is the code I created to test if it is possible to mount and unmount a partition.

    $driveletter = Get-WmiObject -query "Select DeviceID from win32_logicaldisk where volumename = 'Images'"
    $d = $driveletter.DeviceID
    write-host "the driveletter is $d"
    dism /Mount-Image /ImageFile:"$d\sources\boot.wim" /index:1 /MountDir:"$d\Mount"
      Start-Sleep -s 5
    dism /Unmount-Wim /MountDir:"$d\mount" /discard

    • Moved by Bill_Stewart Wednesday, September 13, 2017 9:16 PM This is not Windows deployment forum
    Monday, July 24, 2017 7:57 AM

All replies

  • For issues with how to set up an installable image post in the Windows deployment forum.  This is not a scripting issue but an issue of how to build an installable image on a removable source.


    Monday, July 24, 2017 9:16 AM
  • If you have access to SCCM or WDS why not just create a stand alone media on a pen drive or DVD .  https://docs.microsoft.com/en-us/sccm/osd/deploy-use/create-stand-alone-media

    This way you can build the image without any scripting also even though the image was created via a task sequence in WDS or SCCM does not mean you have to manage them, even though it would be better if you did for compliance reasons alone.

    Thursday, July 27, 2017 9:50 AM