Installing windows features using a WIM file

Installing windows features using a WIM file.
1) use DISM to check which image in the file to use.
DISM /get-wiminfo /wimfile:D:\sources\install.wim
2) start powershell
powershell
3) Install feature
install-windowsfeature xps-viewer -source wim:D:\sources\install.wim:2
(assuming image 2, which is server standard with GUI)
Thanks,
Malcolm