PoshCode Archive  Artifact [18aa2f7047]

Artifact 18aa2f7047b0991a76935914e8fddbedb78c736401e4c9421875aa36d8b8e9cd:

  • File Deploying-VM-with-static.ps1 — part of check-in [7f70145421] at 2018-06-10 13:03:57 on branch trunk — Deploying VM with static IP in 3 lines (user: unknown size: 651)

# 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