Optimize-Offline Guide - Windows Debloating Tool, Windows 1803, 1903, 19H2, 1909, 20H1 and LTSC 2019

Discussion in 'Windows 10' started by KedarWolf, Jul 30, 2019.

    if somebody needs complete list of component removal to create w10 barebone os without any negative results then can ask me in private .
    only applies to w10 not for w11 or other os but script will be same only component packages neeeds to be considered which ones to remove & which ones are mandatory to be kept.

    Credits to abbodi1406 for lettin me know this way we can remove component packages offline as i was not unloading registry before packages removal via pwsh in many of my attempts.
     
  1. nasagih

    nasagih MDL Novice

    Dec 14, 2010
    30
    4
    0
    I want complete script. Let me pm you
     
  2. Here it is but you only need complete component packages list to create BareBone OS . Be Sure Script will take almost 3-4 hours to complete as there are huge numbers of packages to be removed :

     
  3. nasagih

    nasagih MDL Novice

    Dec 14, 2010
    30
    4
    0
    Thank you. I will search complete components packages first.
     
  4. MajkelP

    MajkelP MDL Junior Member

    Nov 11, 2015
    59
    26
    0
    Thank you for answer,

    I left only this and Store works fine, The main problem was with my VM network, I messed up.
    Code:
    [
                            "Microsoft.DesktopAppInstaller",
                            "Microsoft.HEIFImageExtension",
                            "Microsoft.StorePurchaseApp",
                            "Microsoft.VCLibs.140.00",
                            "Microsoft.VP9VideoExtensions",
                            "microsoft.windowscommunicationsapps",
                            "Microsoft.WindowsStore",
                            "Microsoft.YourPhone"
                        ]
    }
     
  5. MajkelP

    MajkelP MDL Junior Member

    Nov 11, 2015
    59
    26
    0

    Thanks, now it is working, the main problem was with my VM network ;)
     
  6. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    428
    10
    For sure interesting, thanks :rolleyes:
     
  7. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    428
    10
    According to the code this message appears if this condition is valid:
    Code:
    Test-Path -Path (GetPath -Path $InstallMount -Child 'Windows\WinSxS\pending.xml')
    Meaning the pending.xml file is there, try to open that file and see what installations are pending (iex. netfx3?)
     
  8. MajkelP

    MajkelP MDL Junior Member

    Nov 11, 2015
    59
    26
    0
  9. absolutely correct . error appears only when there is something pending inside component store to be finished at correct 2 stage of OOBe Phase on offline image scenario . but if current installed os machine reboot will solve it flawlessly.
    very nice boss you are doing awesome :)
     
  10. MajkelP

    MajkelP MDL Junior Member

    Nov 11, 2015
    59
    26
    0
    Thanks, I cannot believe, I did it and did not work, and I tried again and it is working :)
     
  11. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    874
    30
    If FlashUSB is set to true on the latest master. @gdeliana

    Code:
    PS D:\Optimize-Offline-master\Optimize-Offline-master> .\Start-Optimize-BAU-TI.ps1
    Optimize-Offline : A parameter cannot be found that matches parameter name 'Miscellaneous'.
    At D:\Optimize-Offline-master\Optimize-Offline-master\Start-Optimize-BAU-TI.ps1:130 char:18
    + Optimize-Offline @ConfigParams
    +                  ~~~~~~~~~~~~~
        + CategoryInfo          : InvalidArgument: (:) [Optimize-Offline], ParameterBindingException
        + FullyQualifiedErrorId : NamedParameterNotFound,Optimize-Offline
     
  12. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    428
    10
    Due to the new legacy mode i had to change the Flashtousb option, valid values are: off | uefi | legacy
     
  13. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    874
    30
    ty.
     
  14. MajkelP

    MajkelP MDL Junior Member

    Nov 11, 2015
    59
    26
    0
  15. KedarWolf

    KedarWolf MDL Addicted

    Mar 17, 2016
    977
    874
    30
    #1998 KedarWolf, Sep 12, 2022
    Last edited: Sep 12, 2022
    (OP)
    256GB USB drive. testing "legacy".

    Testing now on a 32GB drive.

    Code:
    Index     : 0
    Exception : ScriptHalted
    Category  : OperationStopped: (:) [], RuntimeException
    ErrorID   : ScriptHalted
    Target    :
    Command   : Throw $Error[0]
    Script    : D:\Optimize-Offline-master\Optimize-Offline-master\Src\Public\Write-USB.ps1
    Line      : 87
    Column    : 3
    
    Index     : 1
    Exception : The given path's format is not supported.
    Category  : NotSpecified: (:) [Copy-Item], NotSupportedException
    ErrorID   : System.NotSupportedException,Microsoft.PowerShell.Commands.CopyItemCommand
    Target    :
    Command   : Copy-Item -Path "$($ISOMount):\*" -Destination "$($USBVolume.DriveLetter):" -Recurse -Force -Exclude $(If
                (!$Legacy) {"boot.wim"} Else {$null})
    Script    : D:\Optimize-Offline-master\Optimize-Offline-master\Src\Public\Write-USB.ps1
    Line      : 79
    Column    : 3
    
    Index     : 2
    Exception : Size Not Supported
                Activity ID: {e9da36b3-7215-40d3-ab54-056dd0c796cc}
    Category  : NotSpecified: (StorageWMI:ROOT/Microsoft/...age/MSFT_Volume) [Format-Volume], CimException
    ErrorID   : StorageWMI 4097,Format-Volume
    Target    : MSFT_Volume (ObjectId = "{1}\\KEDARWOLF-PC\root/Microsoft/Window...)
    Command   : Format-Volume -FileSystem $(If ($Legacy) {"FAT32"} Else {"NTFS"}) -NewFileSystemLabel "$((Get-Volume
                -DriveLetter $ISOMount).FileSystemLabel)"
    Script    : D:\Optimize-Offline-master\Optimize-Offline-master\Src\Public\Write-USB.ps1
    Line      : 77
    Column    : 3
    
    32GB USB
    Code:
    Index     : 0
    Exception : The parameter is incorrect.
                
    Category  : WriteError: (install.wim:FileInfo) [Copy-Item], IOException
    ErrorID   : CopyDirectoryInfoItemIOError,Microsoft.PowerShell.Commands.CopyItemCommand
    Target    : install.wim
    Command   : Copy-Item -Path "$($ISOMount):\*" -Destination "$($USBVolume.DriveLetter):" -Recurse -Force -Exclude $(If
                (!$Legacy) {"boot.wim"} Else {$null})
    Script    : D:\Optimize-Offline-master\Optimize-Offline-master\Src\Public\Write-USB.ps1
    Line      : 79
    Column    : 3
     
  16. gdeliana

    gdeliana MDL Senior Member

    Oct 2, 2010
    365
    428
    10
    Sorry guys, didn't had these errors when i was testing, however took another approach, hopefully now it will be OK :)
    Test the latest commit whenever you want
     
  17. MajkelP

    MajkelP MDL Junior Member

    Nov 11, 2015
    59
    26
    0
    #2000 MajkelP, Sep 12, 2022
    Last edited: Sep 12, 2022
    No worries, Thank you for your commitment, I am going to test tonight :)