2017-12-06 2 views
0

正しい方向にこのDISM出力をPowershellオブジェクトに変換する方法を教えてください。結果をフィルタリングするためにスクリプトで使用できますか?私が手 dism /Get-WimInfo /WimFile:"E:\_Source\OSD\x64\Windows 10 Enterprise\1607\Media\WIM\REFW10-X64-1607_04-12-2017.wim" /index:1DISM出力をPSオブジェクトに変換する

アウトプットは次のとおりです。

Deployment Image Servicing and Management tool Version: 10.0.14393.0 

Details for image : E:\_Source\OSD\x64\Windows 10 Enterprise\1607\Media\WIM\REFW10-X64-1607_04-12-2017.wim 

Index : 1 Name : REFW10-X64EN-01EDrive 
Description : Build Windows 10 Enterprise x64 en-US 

Size : 18.500.052.305 bytes 

WIM Bootable : No 

Architecture : x64 

Hal : acpiapic 

Version : 10.0.16299 

ServicePack Build : 15 

ServicePack Level : 64 

Edition : Enterprise 

Installation : Client 

ProductType : WinNT 

ProductSuite : Terminal Server 

System Root : WINDOWS 

Directories : 24025 

Files : 112737 

Created : 24-11-2017 - 01:40:49 

Modified : 24-11-2017 - 01:40:51 

Languages :  en-US (Default) 

私は| Out-String -Stream | Select-String "Version " と試みたが、運...

+0

私はあなたが使うべきだと思います代わりに関連する[Get-WindowsImage](https://docs.microsoft.com/powershell/module/dism/get-windowsimage?view=win10-ps)コマンドレットを使用します。 – iRon

+0

すでにDISM get-wiminfoと同じくらい詳細ではありません。ビルド番号と言語を使いたいです。 – user7490700

+0

'dism/Get-WimInfo/WimFile:" C:\ ... "/ index:1 |選択文字列 "バージョン"は私のために働く... – iRon

答えて

0

がそれを一緒に置くと:

$WimFile = "E:\_Source\OSD\x64\Windows 10 Enterprise\1607\Media\WIM\REFW10-X64-1607_04-12-2017.wim" 
$Version = (dism /Get-WimInfo /WimFile:$WimFile /index:1 | Select-String "Version ").ToString().Split(":")[1].Trim() 
$Language = ((dism /Get-WimInfo /WimFile:$WimFile /index:1 | Select-String "Languages " -Context 0,1).ToString() -Split "\s\(Default\)" -Split "\s")[-2] 
関連する問題