mikedopp

OSCustomization

Aug 5th, 2016
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
Add Comment
Please, Sign In to add comment