Powershell DISM 新 Windows 映像:使用 CompressionType 会出现错误

MDM*_*313 5 powershell disk-image wim dism windows-server-2012-r2

PS C:\ProgramData\Microsoft\Windows\Hyper-V\BigHomie> New-WindowsImage -CapturePath K: -ImagePath C:\VHDImports\Win764.wim -name "BigHomies Personal Image" -Verify -CompressionType "Max"
Run Code Online (Sandbox Code Playgroud)

抛出以下错误:

    New-WindowsImage : The given key was not present in the dictionary.
At line:1 char:1
+ New-WindowsImage -CapturePath K: -ImagePath C:\VHDImports\Win764.wim -name " ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [New-WindowsImage], KeyNotFoundException
    + FullyQualifiedErrorId : System.Collections.Generic.KeyNotFoundException,Microsoft.Dism.Commands.NewWindowsImageC
   ommand
Run Code Online (Sandbox Code Playgroud)

我会说在不带-CompressionType参数的情况下运行此命令会运行并提供一个未压缩的 .wim 文件。运行此瓦特/出给人一种说法-CompressionType参数给出我需要提供类型的参数错误System.String

Google 对这个特定错误几乎没有发现,这些错误似乎都不适用于我的情况,而且这些结果都与 powershell 发生的错误无关,更不用说这个特定的 cmdlet。

Bin*_*Bin 2

“压缩类型”参数似乎只接受小写字符串maxfastnone

请改用以下命令:

New-WindowsImage -CapturePath K: -ImagePath C:\VHDImports\Win764.wim -name "BigHomies Personal Image" -Verify -CompressionType max
Run Code Online (Sandbox Code Playgroud)