Skip to content

Windows PowerShell module to create one or more Windows To Go drives.

License

Notifications You must be signed in to change notification settings

FirbyKirby/WindowsToGo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Windows To Go Creator

DESCRIPTION

This module, once installed, will allow a user to create Windows To Go drives from PowerShell (PoSh.) It will allow a user to run the New-WindowsToGo command at the PoSh command prompt.

The New-WindowsToGo function will create one or more Windows To Go drives. It can create up to 11 drives in parallel. All drives should be Windows To Go certified and attached to the host computer before running this function. You must supply the path to a Windows Image file (.wim) that will be applied to the USB drives during the creation process. If required, you can also supply an unattended installation answer file (.xml) which will be inserted into each drive during creation. A driver, or collection of drivers in a folder, (with the extension .inf) can also be specified and the function will inject them into the USB drive(s) created.

When executed, this function will check for the correct PowerShell version, administrator privelages, validity of any file paths supplied, presence of USB drives large enough to fit the supplied image, and prompts the user to select exactly which attached USB drives to use before commiting to the creation process.

REQUIREMENTS

PowerShell version 5.0 or later (usually included with Windows 10 or later.)

INSTALLATION

  1. Move the sub-folder WindowsToGo into the %USERPROFILE%\Documents\WindowsPowerShell\Modules folder. If this folder does not exist, create it.
    NOTE: %USERPROFILE% is your user's folder in Windows. It's usually C:\Users\[your user name].
  2. Open an elevated PoSh command prompt by pressing Windows Key + W and typing powershell. Right click Windows PowerShell in the resultant listing and choose Run as Administrator.
  3. Type Set-ExecutionPolicy Unrestricted at the command prompt and press enter. Choose Yes at the confirmation prompt.
    WARNING: This will reduce your security level when using PowerShell and will allow non-microsoft certified scripts and functions to run (like this one,) but the risk should be minimal if you're an infrequent PowerShell user. You can reverse this change after you've finished using the function in this module by typing Set-ExecutionPolicy Restricted at the command prompt.
  4. Type Get-Module -ListAvailable at the command prompt and confirm that WindowsToGo is listed under Name in the _%USERPROFILE%\Documents\WindowsPowerShell\Modules_ folder (this should be near the top of the output produced, right under the command prompt entry and you'll probably need to scroll up to find it.)
  5. Once you've confirmed that the module is available in Step 3, type Import-Module WindowsToGo at the command prompt. This will import the WindowsToGo module and make it available as a function you can call anywhere and at any time.
    NOTE: If the Import-Module command works correctly, you will not see any output or feedback from running the command. You'll just get another command prompt.

DOCUMENTATION

Once the module is installed, you can learn how to use the module and the New-WindowsToGo command by typing Get-Help New-WindowsToGo at a PoSh command prompt.

USAGE

  1. Open an elevated PoSh command prompt by pressing Windows Key + W and typing powershell. Right click Windows PowerShell in the resultant listing and choose Run as Administrator.
  2. Type New-WindowsToGo and then enter the appropriate parameters and press enter. Use Get-Help New-WindowsToGo at the PoSh command prompt if you need help using the function

EXAMPLES

PS> New-WindowsToGo D:\sources\install.wim
Create Windows To Go disk(s) using Windows installation media attached to the computer (usually through DVD or USB.)

PS> New-WindowsToGo D:\sources\install.wim -Drivers ~\Desktop\Drivers\
Create Windows To Go disk(s) using Windows installation media attached to the computer. Inject .inf drivers found in "Drivers" folder on user's desktop.

PS> New-WindowsToGo ~\Desktop\myimage.wim -UnattendPath ~\Desktop\unattend.xml -MinimumFreeSpace 8GB
Create Windows To Go disk(s) using a custom windows image file called "myimage.wim". Insert a custom unattended installtion file called "unattend.xml" into the Windows To Go drive(s). Ensure that the drive(s) have at least 8GB of free space remaining after creation.

PS> New-WindowsToGo ~\Desktop\myimage.wim -NoPrompts
Create Windows To Go disk(s) using a custom windows image file called "myimage.wim". Do not prompt the user for input and image all compatible drives attached to the host computer.

NOTES

To improve performance while using the New-WindowsToGo function, disable any real-time virus scan or security software. For example, turn off Windows Defender's real-time protection.

UPGRADES

If you would like to upgrade you're module, delete the contents of %USERPROFILE%\Documents\WindowsPowerShell\Modules\WindowsToGo and repeate the installation process listed above for the new version. Be sure to restart your PoSh session or run the Import-Module command with the -Force switch, like this.
Import-Module WindowsToGo -Force

SUPPORT

For support, visit the GitHub Repository and create an issue.

SPECIAL THANKS

This module was created by generously leveraging the following sample scripts.

====== This repository and any materials provided by NI therein are provided AS IS. NI DISCLAIMS ANY AND ALL LIABILITIES FOR AND MAKES NO WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY WARRANTIES OF MERCHANTABILITY, FITNESS FOR PARTICULAR PURPOSE, OR NON-INFRINGEMENT OF INTELLECTUAL PROPERTY. NI shall have no liability for any direct, indirect, incidental, punitive, special, or consequential damages for your use of the repository or any materials contained therein.

About

Windows PowerShell module to create one or more Windows To Go drives.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published