We help IT Professionals succeed at work.

Need PowerShell for building Numbers of MDT, ADK, WinPE of my Deployment Server.

zero000kool
zero000kool asked
on
Can anyone provide me with a simple PowerShell script that will output the build numbers for an MDT deployment server.
I need to know the build numbers for ADK, WinPE, MDT

Much appreciated and I am a beginner PowerShell person.
Comment
Watch Question

Distinguished Expert 2019
Commented:
$adk = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files (x86)\Windows Kits\10\tools\bin\i386\appxcommon.dll").FileVersion
$winpe= [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files (x86)\Windows Kits\10\Assessment and Deployment Kit\Deployment Tools\amd64\DISM\DISM.EXE").FileVersion
$MDT = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Program Files\Microsoft Deployment Toolkit\Bin\Microsoft.BDD.Actions.dll").FileVersion
write-host ("The Windows PE version is: {0}" -f $winpe)
write-host("The MDT Version is: {0}" -f $MDT )
write-host("The ADK Version is: {0}" -f $adk )

Open in new window

Author

Commented:
How do I output it to a file, I tried putting at the end of the script:
out-File FilePath c:\test.txt

It output nicely to the screen but nothing in the txt file.  

BTW this is awesome thanks a lot, being I'm learning PS,  I understand the concept of the script.
Thanks again.
Distinguished Expert 2019
Commented:
change write-host to write-output
add the following to each output line
 | out- file   -path c:\test\test.txt -append 

Open in new window

Author

Commented:
Thanks David this was awesome.  Really appreciate it, and you really helped me.    Your the best