Friday, January 25, 2019

Windows–DISM PowerShell Replacement

So you need to find the version of windows on your ISO file but you named it windows.iso … well here is how we solved that using DISM
dism /Get-WimInfo /WimFile:F:\sources\install.esd /index:1
Now using PowerShell
Get-WindowsImage –imagepath .\install.wim
but what if you don’t have the install.wim … look for install.esd instead
Get-WindowsImage –impagepath .\install.esd






















References
https://www.computerworld.com/article/3309257/microsoft-windows/grab-a-free-copy-of-win10-version-1803-and-save-it-for-a-rainy-day.html
https://www.winhelponline.com/blog/iso-find-windows-build-version-edition-using-dism/
https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/use-dism-in-windows-powershell-s14

Tuesday, January 8, 2019

Fun PowerShell

Roll fair dice

Input the number of pips on the die
Input the number of rolls

reference doc.microsoft.com
PS /> 1..1200 | ForEach-Object { 1..6 | Get-Random } | Group-Object | Select-Object Name,Count
Name Count
---- -----
1      206
2      199
3      196
4      226
5      185
6      188
https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/get-random?view=powershell-6