Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade

How to Export a Windows Image Using PowerShell

Exporting a Windows image is a crucial task for system administrators who need to create backups, deploy new systems, or migrate existing setups. The Export-WindowsImage cmdlet in PowerShell allows you to export a Windows image (.wim) file to another location. This cmdlet is particularly useful when you need to customize and deploy Windows images across multiple machines efficiently. This article will guide you through the process of using the Export-WindowsImage cmdlet in PowerShell to export a Windows image.

Examples:

Example 1: Exporting a Windows Image to a New File

  1. Open PowerShell as Administrator:

    • Press Win + X and select "Windows PowerShell (Admin)" or "Windows Terminal (Admin)" if you are using Windows Terminal.
  2. Identify the Source Image:

    • First, you need to know the location of your source .wim file. For this example, let's assume it's located at C:\Images\install.wim.
  3. Run the Export-WindowsImage Cmdlet:

    • Use the following command to export the image to a new file:

      Export-WindowsImage -SourceImagePath C:\Images\install.wim -SourceIndex 1 -DestinationImagePath C:\ExportedImages\custom_install.wim -CheckIntegrity
    • Parameters:

      • -SourceImagePath: Specifies the path to the source .wim file.
      • -SourceIndex: Specifies the index of the image within the .wim file (use 1 if there's only one image).
      • -DestinationImagePath: Specifies the path where the exported .wim file will be saved.
      • -CheckIntegrity: Verifies the integrity of the .wim file during the export process.

Example 2: Exporting a Specific Image Index from a Multi-Index .wim File

  1. List Images in the .wim File:

    • Before exporting, you might want to list all images within the .wim file to identify the correct index:
      Get-WindowsImage -ImagePath C:\Images\install.wim
  2. Export the Desired Image Index:

    • After identifying the correct index, use the Export-WindowsImage cmdlet to export the specific image:
      Export-WindowsImage -SourceImagePath C:\Images\install.wim -SourceIndex 2 -DestinationImagePath C:\ExportedImages\custom_install_index2.wim -CheckIntegrity

Example 3: Compressing the Exported Image

  1. Use the -CompressionType Parameter:

    • You can specify the compression type to reduce the size of the exported .wim file:

      Export-WindowsImage -SourceImagePath C:\Images\install.wim -SourceIndex 1 -DestinationImagePath C:\ExportedImages\compressed_install.wim -CheckIntegrity -CompressionType Maximum
    • Compression Types:

      • Fast: Provides faster compression.
      • Maximum: Provides maximum compression, resulting in a smaller file size.

To share Download PDF

Gostou do artigo? Deixe sua avaliação!
Sua opinião é muito importante para nós. Clique em um dos botões abaixo para nos dizer o que achou deste conteúdo.