SHOW:
|
|
- or go back to the newest paste.
| 1 | function SetIP {
| |
| 2 | get-OSCustomizationSpec "Windows" | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping ` | |
| 3 | -IpMode UseStaticIP ` | |
| 4 | -IpAddress $IP ` | |
| 5 | -SubnetMask $NetMask ` | |
| 6 | -DefaultGateway $Gateway ` | |
| 7 | -Dns $DNS | |
| 8 | } | |
| 9 | ####Deployment#### | |
| 10 | Function Deploy {
| |
| 11 | $OSCustomizationSpec | SetIP | |
| 12 | New-VM -Name ($VMName + $_) ` | |
| 13 | -Template $template ` | |
| 14 | -ResourcePool $Pool ` | |
| 15 | -Datastore $datastore ` | |
| 16 | -OSCustomizationSpec $OSCustomizationSpec | |
| 17 | #Start-VM -VM ($VMName + $_) | |
| 18 | } |