Skip to content

Instantly share code, notes, and snippets.

@devblackops
Last active August 29, 2015 14:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save devblackops/56b55fbc82b96700633b to your computer and use it in GitHub Desktop.
Save devblackops/56b55fbc82b96700633b to your computer and use it in GitHub Desktop.
Modify VMware OS customization spec
PowerCLI C:\> $spec = get-oscustomizationspec win2k12_dsc
PowerCLI C:\> $spec | fl guirunonce
GuiRunOnce : {c:\windows\system32\windowspowershell\v1.0\powershell.exe c:\temp\dscbootstrap.ps1}
PowerCLI C:\> $specClone = new-oscustomizationspec -OSCustomizationSpec $spec -Type NonPersistent
PowerCLI C:\> $specClone | fl guirunonce
GuiRunOnce : {c:\windows\system32\windowspowershell\v1.0\powershell.exe c:\temp\dscbootstrap.ps1}
PowerCLI C:\> $tempSpec = set-oscustomizationspec -OSCustomizationSpec $specClone -GuiRunOnce "c:\windows\system32\windowspowershell\v1.0\powershell.exe c:\temp\dscbootstrap -newGuid 'dab3fd12-0bdd-4c7a-be8f-5c346bb763ca'"
PowerCLI C:\> $tempSpec | fl guirunonce
GuiRunOnce : {c:\windows\system32\windowspowershell\v1.0\powershell.exe c:\temp\dscbootstrap.ps1 -guid 'dab3fd12-0bdd-4c7a-be8f-5c346bb763ca'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment