{"id":14980260,"url":"https://github.com/cltcc-bryanbroussard99/unattendedinstall","last_synced_at":"2026-01-21T17:03:33.472Z","repository":{"id":244867532,"uuid":"816514893","full_name":"CLTCC-bryanbroussard99/UnattendedInstall","owner":"CLTCC-bryanbroussard99","description":"Powershell script to automate app install with winget","archived":false,"fork":false,"pushed_at":"2024-06-21T21:11:34.000Z","size":66,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T22:16:24.111Z","etag":null,"topics":["powershell","powershell-script","winget"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CLTCC-bryanbroussard99.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-17T23:05:21.000Z","updated_at":"2024-12-30T22:29:52.000Z","dependencies_parsed_at":"2024-06-22T11:12:24.306Z","dependency_job_id":"06fa86c0-a2cb-49f3-a6b8-c5c62c1551d2","html_url":"https://github.com/CLTCC-bryanbroussard99/UnattendedInstall","commit_stats":null,"previous_names":["cltcc-bryanbroussard99/unattendedinstall"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CLTCC-bryanbroussard99%2FUnattendedInstall","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CLTCC-bryanbroussard99%2FUnattendedInstall/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CLTCC-bryanbroussard99%2FUnattendedInstall/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CLTCC-bryanbroussard99%2FUnattendedInstall/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CLTCC-bryanbroussard99","download_url":"https://codeload.github.com/CLTCC-bryanbroussard99/UnattendedInstall/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557741,"owners_count":20958046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","powershell-script","winget"],"created_at":"2024-09-24T14:01:31.483Z","updated_at":"2026-01-21T17:03:28.429Z","avatar_url":"https://github.com/CLTCC-bryanbroussard99.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# UnattendedInstall\nThis tutors you on the process to create a iso file to automate OS installs\n\nWhat you'll need\n\nA clean installation of Windows.\nYou can do this on real hardware or on a virtual machine.\nWe're using VirtualBox. https://www.virtualbox.org/wiki/Downloads\nPacket Tracer is not available through winget. You will need to install it separately. - https://skillsforall.com/resources/lab-downloads (login required)\n\nStep 1: Setting up the Windows installation\n\nIn order to set up the custom ISO, you're going to first need to set up a clean installation of Windows in what we're going to call a \"reference machine\".\n\n- Boot your reference machine and go through the initial installation process until the first reboot. You'll want to stop at the 'Is this the right country or region' screen.\n- Press Ctrl + Shift + F3 to restart your PC in Audit Mode.\n- Once in Audit Mode, leave the System Preparation Tool window open.\n- Connect your PC to the internet and install any programs you want and make other customizations of your choice.\n- Open Notepad and enter the text in this link ( https://github.com/CLTCC-bryanbroussard99/UnattendedInstall/blob/main/unattend.xml ) if you have a 64-bit Windows install (any Windows 11 PC will fall under this umbrella)\n- Click File \u003e Save As and set the Save as type menu to All types. Navigate to C:\\Windows\\System32\\Sysprep and save the file with the name unattend.xml (it needs to be this name).\n- The file above will make it so that changes made to the current user profile will be visible in the Home/Quick Access page for the default user profile in the Windows installations that use the ISO we're creating. To prevent this, we need to create a batch file that removes these folders from view on the first login:\n    - Open the Start menu and search for Notepad and choose Run as administrator.\n    - Paste the text in this link( https://github.com/CLTCC-bryanbroussard99/UnattendedInstall/blob/main/cleanup.bat ) into the file.\n    - Click File \u003e Save As and set the Save as type menu to All files and name it cleanup.bat (or any name ending in .bat). Navigate to %appdata%\\Microsoft\\Windows\\Start Menu\\Programs\\Startup and save the file there.\n- Open the Start menu and search for cmd then click Run as administrator.\n- Enter the following command and press Enter:\n     cmd.exe /c Cleanmgr /sageset:65535 \u0026 Cleanmgr /sagerun:65535\n- In the Disk Cleanup dialog, select every possible option and then click Clean. Don't close Command Prompt until the process finishes.\n- - Now, open Disk Management (you can search for it in the Start menu).\nRight-click your C: partition and click Shrink volume. Choose a shrink amount around 15GB (15000MB) (don't be afraid to go higher if you installed a lot of software).\n- Create a new volume in the newly unallocated space and call it Image. Rename the C: partition to something like Windows to make them easier to identify (this may be helpful later).\n- Open File Explorer and open the Image drive, then create a new folder inside it called Scratch.\n- If you're using Hyper-V, at this point, click Action \u003e Checkpoint in your Hyper-V window, to be safe.\n- Go back to the System Preparation Tool window, under System Cleanup Action, choose Enter System Out-of-Box Experience (OOBE) and check the Generalize box.\n- Under Shutdown options, choose Shutdown. Click OK\n- Click OK and your PC will turn off and restart\n\nStep 2: Creating the install.wim file\n\nNow that you have the system set up as you want it to be, it's time to package it into an image file that can be used for installation. Here's how it works\n\n- Boot your reference machine (VM) using a standard Windows installation media (it can be the same you used for the initial Windows installation).\n- On the installation screen where you see the language options, press Shift + F10 to open Command Prompt.\n- Enter the following command and press Enter:\n    diskpart\n- Now, enter this command:\n    list vol\n- Identify the Windows partition and the Image partition you created in the steps above. Note the drive letters for each one, which may be different from what they were before.\n- Exit diskpart with the following command (don't close Command Prompt):\n    exit\n- Enter the following command, replacing C: with the drive letter for the partition with the Windows installation and D: with the drive letter for the Image drive (if needed):\n    dism /capture-image /imagefile:D:\\install.wim /capturedir:C:\\ /ScratchDir:D:\\Scratch /name:\"CustomWindows\" /compress:maximum /checkintegrity /verify /bootable\n\n    - You can also replace the name CustomWindows with anything you prefer.\n\n- This process will take some time to complete, especially if you have a slower machine. Once it's done, turn off the machine.\n\nStep 3: Creating the ISO\n\nWith the install.wim file now created, it's time to create the ISO itself. At this point, you can either boot the reference machine or use your host machine to avoid having to do the rest of the process in a VM. If you choose the latter option, you have to copy the install.wim file you just created from your VM to your host machine. This is the easier route. Here's how to do that:\n\n- On your host machine, open Disk Management.\n- Click Action \u003e Attach VHD.\n- Step 3: Creating the ISO\nWith the install.wim file now created, it's time to create the ISO itself. At this point, you can either boot the reference machine or use your host machine to avoid having to do the rest of the process in a VM. If you choose the latter option, you have to copy the install.wim file you just created from your VM to your host machine. This is the easier route. Here's how to do that:\n\n- On your host machine, open Disk Management.\n- Click Action \u003e Attach VHD.\n- Click Browse and navigate to where your VHDs are stored (for Hyper-V, this is C:\\ProgramData\\Microsoft\\Windows\\Virtual Hard Disks.\n- Change the dropdown menu in the bottom right corner to All files so you can see the AVHDX files, which represent your checkpoints. Pick the most recent one for your reference machine\n- Check the Read-only box.\n- Click OK.\n- In File Explorer, navigate to the Image partition where your install.wim file is and copy it to a location of your choice on your physical drive (most likely drive C:).\n- Go back to Disk Management, rigt-click the VHD, and choose Detach VHD, then click OK\n- If you're using the reference machine, you'll just have to go through the Windows 11 setup as usual so you can get to the desktop. In either case, you'll then be ready to follow the steps below.\n\nUsing the Windows ADK to create an ISO\n- Mount a recent, standard Windows ISO as a virtual drive and open it.\n- Copy the contents of the virtual drive into a new folder in the root of your main partition. You can name this folder anything you want, but we'll go with ISO (so the folder path is C:\\ISO).\n- If you're using the VM, go into the Image partition we created earlier and copy the install.wim file. If you moved the install.wim file to your host machine, copy it from that location.\n- Go to your ISO folder and open the sources folder, and paste the install.wim file, replacing the one that's already ther\n- Download the latest version of the Windows Assessment and Deployment Kit (ADK) from Microsoft's website.\n- Launch the installer and follow the basic steps. When you get to this screen, make sure the Deployment Tools option is selected (you can deselect everything else), then click Install.\n- Once it's installed, navigate to the All apps section of the Start menu and expand the Windows Kits folder. Right-click Deployment and Imaging ToolsEnvironment and choose Run as administrator.\n- Type the following command and press Enter to go to the root of the drive:\n    cd\\\n- Now, enter the following command to generate an ISO file using those files:\n    oscdimg.exe -m -o -u2 -udfver102 -bootdata:2#p0,e,bc:\\ISO\\boot\\etfsboot.com#pEF,e,bc:\\ISO\\efi\\microsoft\\boot\\efisys.bin c:\\ISO c:\\CustomWindows.iso\n- You may need to replace c:\\ISO depending on the folder path where you chose to store the ISO files in step 2. You can also replace c:\\CustomWindows.iso at the end with the path and name of your choice for the ISO file.\n- The process may take some time, but when it's done, you'll have your ISO file ready to use. You can use it as the installation source for future VMs, or use Rufus to create USB installation media so you can use it to set up a physical PC. The ISO should be hardware-agnostic, so it will work on any PC. If you did all the steps on real hardware, you may also want to back up the ISO file to a different location in case you want to reset your PC afterward.\n\nHave your Windows installation ready faster\n\nWhile the process may seem complicated, it's fairly easy to get things up and running if you follow the steps carefully. And if you do, you'll be able to get your PCs up and running faster in the future, since all your apps will be there by default, so it can save you time in the long run.\n\nReference: https://www.xda-developers.com/how-create-custom-windows-iso/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcltcc-bryanbroussard99%2Funattendedinstall","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcltcc-bryanbroussard99%2Funattendedinstall","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcltcc-bryanbroussard99%2Funattendedinstall/lists"}