Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 182126

-OScustomizationspec is not working properly with New-VM cmdlet

$
0
0

Hello,

 

I have a template (Not Content Lib Template) and deploying VM through this with -OSCustomizationSpec Switch. However i can see the VM deployment task and could also locate the VM but somehow it is not applying -OSCustomization Spec. Any help Here?

 

Below is the Code.

 

 

$Template=Get-Template "SGAStemplate-WIN2012R2-20180301"
$mySpecification = Get-OSCustomizationSpec -Name RaaS-CRSR 
New-VM -Name VMYouCanDelete -Template $Template -ResourcePool 'sol-mgmt' -OSCustomizationSpec $mySpecification 

 

 

Error:

New-VM : 1/17/2019 10:13:37 AM  New-VM          Operation is not valid due to the

current state of the object.

At C:\users\Administrator\Desktop\Scripts\PowerShell\RaaS\TestCustSpec.ps1:4

char:1

+ New-VM -Name VMYouCanDelete -Template $Template -ResourcePool 'sol-mg ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [New-VM], VimException

    + FullyQualifiedErrorId : Core_BaseCmdlet_UnknownError,VMware.VimAutomatio

   n.ViCore.Cmdlets.Commands.NewVM


Viewing all articles
Browse latest Browse all 182126

Trending Articles