Automate Image Deployment by Customizing Image Contents
- Start with a regular Windows WIM image, right off the DVD ISO media
- Remove unneeded installation options
- Apply updates
- Pre-stage drivers
- Enable Hyper-V role

get-module
Get-Command -Module dism
Get-Windowslmage -imagePath c:\hyperv\install.wim
Remove-windowslmage -ImagePath c:\hyperv\install.wim -Index 1

dism module is available OOB (out of the box)

Update Image
- download update - example: KB3199209
- mkdir c:\offline
get-module
Get-Command -Module dism
Get-Windowslmage -imagePath c:\hyperv\install.wim
Remove-windowslmage -ImagePath c:\hyperv\install.wim -Index 1
Mount-windowslmage -ImagePath C:\hyperv\install.wim -index 1 -path c:\offline
Add-WindowsPackage -Path c:\offline -PackagePath c:\hyperv\updates
Add-WindowsDriver -Path c:\offline -Driver c:\hyperv\drivers -Recurse
Get-windowsOptionalFeature -path C:\offline
Get-WindowsOptionalFeature -path C:\offline | where featurename -like "*hyper*"
Enable-windowsoptionalFeature -Path C:\offline -FeatureName microsoft-hyper-v -all
Dismount-windowslmage -Path C:\offline -save
## diskpart - partition disk on VM FAT32/100MB s:, NTFS rest n:
netsh interface ip set address name-"ethernet0" static 192.168.3.191 255.255.255.0 192.168.3.2
net use z: \\192.168.3.190\c$ /user:<domain>\<user>
dism /apply-image /imagefile:z:\hyperv\install.wim /index:l /applydir:n:\
bcdboot n:\windows /s s:
wpeutil reboot
powershell
New-NetlPAddress -InterfaceAlias ethernet0 -iPAddress 192.168.3.200 -Prefix Length 24 -DefaultGateway 192.168.3.2
set-DnsClientserverAddress -InterfaceAlias ethernet0 -serverAddresses 192.168.3.10
New-NetFirewallRule -DisplayName "allow all traffic" -Direction Outbound -Action Allow
New-NetFirewallRule -DisplayName "allow all traffic" -Direction Inbound -Action Allow
Add-Computer -NewName hypervl -DomainName <domain> -Restart
New-NanoServerlmage -Edition standard -DeploymentType host
New-NanoServerlmage -Edition standard -DeploymentType host -MediaPath c:\ -BasePath c:\nanoserver TargetPath C:\NanoServer\nanoserver2\nanoserver2.wim -ComputerName nanoserver2 -OEMDrivers -Compute


Deploy Nano Server
Introducing the Nano Server Image Builder - create nano image, bootable usb media
MAP - Microsoft Assessment and Planning Toolkit