Problem creating GPT VHD automatically

Page 4 of 4 FirstFirst ... 234

  1. Posts : 15,480
    Windows10
    Thread Starter
       #31

    Kari said:
    A PS one-liner to check if $MountFolder has any files left from a previous mount, thus being not empty:

    if (Test-Path $MountFolder\*) {Dismount-WindowsImage -Discard -Path $MountFolder}

    Kari
    Thanks - I have added it to the script after line as shown.

    Tested it and if I interrupt it now, script works fine on rerunning.

    Problem creating GPT VHD automatically-image.png
      My Computer


  2. Posts : 15,480
    Windows10
    Thread Starter
       #32

    @Kari,

    I got this error when changing vhd name and path. Seems to have carried on ok though.

    Problem creating GPT VHD automatically-image.png
      My Computer


  3. Posts : 17,661
    Windows 10 Pro
       #33

    cereberus said:
    @Kari,

    I got this error when changing vhd name and path. Seems to have carried on ok though.
    The original VHDX path is in $VHDName variable, but in your case that VHDX is currently not mounted. I do not know why. I'll test something. Because mounting an unmounting takes time, so does my reply; i post back as soon as I've done.

    Kari
      My Computer


  4. Posts : 17,661
    Windows 10 Pro
       #34

    OK Martin, I cannot get it to fail. Have you changed some of those static variables (original script lines 86 to 94), or any variables in module for creating either MBR or GPT DISKPART script (lines 254 to 317), or in copy module (320 to 362)?

    Kari
      My Computer


  5. Posts : 15,480
    Windows10
    Thread Starter
       #35

    Kari said:
    OK Martin, I cannot get it to fail. Have you changed some of those static variables (original script lines 86 to 94), or any variables in module for creating either MBR or GPT DISKPART script (lines 254 to 317), or in copy module (320 to 362)?

    Kari
    No. Anyway, it still worked ok. Only line I changed was the install.wim location to F drive. (F:\WIM).

    I will step through the ps file till I get to error.
      My Computer


  6. Posts : 17,661
    Windows 10 Pro
       #36

    I am working on the script. Dual boot, either on a partition or VHD. All host drivers, no drivers, or specific drivers. All optional features, some optional features, or no optional features. Trying to make it as perfect and complete as possible.

    Kari
      My Computer


  7. Posts : 15,480
    Windows10
    Thread Starter
       #37

    Kari said:
    I am working on the script. Dual boot, either on a partition or VHD. All host drivers, no drivers, or specific drivers. All optional features, some optional features, or no optional features. Trying to make it as perfect and complete as possible.

    Kari
    A win10S option is handy so you can lockdown a pc for those click happy relatives.

    In the end I have already done all this in my cmd script I sent you. You are just creating a powershell version.
      My Computer


  8. Posts : 17,661
    Windows 10 Pro
       #38

    cereberus said:
    In the end I have already done all this in my cmd script I sent you. You are just creating a powershell version.
    Yes. I want to see how it could be done with PowerShell.

    Kari
      My Computer


  9. Posts : 15,480
    Windows10
    Thread Starter
       #39

    Kari said:
    Yes. I want to see how it could be done with PowerShell.

    Kari
    It could be perception but it seemed to take a lot longer using powershell rather than command.

    I need to benchmark it.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 11:00.
Find Us




Windows 10 Forums