# encoding: ascii
# api: powershell
# title: Deploying VM with static
# description: Deploying VM with static IP in 3 lines
# version: 0.1
# license: CC0
# x-poshcode-id: 2003
# x-archived: 2010-07-23T17:50:12
#
#
$custSpec = New-OSCustomizationSpec -Type NonPersistent -OSType Windows -OrgName TestOrgName -FullName TestFullName -Workgroup TestWorkgroup
$custSpec | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress 10.23.121.228 -SubnetMask 255.255.248.0 -Dns 10.23.108.1 -DefaultGateway 10.23.108.1
New-VM -Name MyDeployedVM -Template $template -VMHost $vmHost -OSCustomizationSpec $custSpec