VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Error while creating a Linux Customization

Hi,

I am getting the below error for Linux Customisation script. Please help!!!

$sCust = @{
Name = 'MyLPSRHCust'
OSType = 'Linux'
TimeZone = 020
Domain = 'MYTESTORG.COM'
FullName = 'MYTESTORG'
OrgName = 'MYTESTORG'
Type = 'Persistent'
NamingScheme = 'VM'
ChangeSID = $true
}
$Custo = New-OSCustomizationSpec @sCust
$sCustNic = @{
IpMode = 'UseStaticIp'
IpAddress = $freeip
DefaultGateway = '192.168.0.1'
SubnetMask = '255.255.255.0'
Dns = '192.168.1.5', '192.168.1.6'
}
Get-OSCustomizationSpec $Custo | Get-OSCustomizationNicMapping @sCustNic

 

New-OSCustomizationSpec : 12/16/2022 2:36:10 AM New-OSCustomizationSpec You must specify only parameters that belong to the same parameter set, Windows or Linux.
At D:\VM_Deployment.ps1:108 char:14
+ $Custo = New-OSCustomizationSpec @sCust
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [New-OSCustomizationSpec], InvalidArgument
+ FullyQualifiedErrorId : Core_NewCustomizationSpec_DoWork_WrongParameterSet,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewCustomizationSpec

Get-OSCustomizationSpec : Cannot validate argument on parameter 'Name'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
At D:\VM_Deployment.ps1:116 char:25
+ Get-OSCustomizationSpec $Custo | Get-OSCustomizationNicMapping | Set- ...
+ ~~~~~~
+ CategoryInfo : InvalidData: (:) [Get-OSCustomizationSpec], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,VMware.VimAutomation.ViCore.Cmdlets.Commands.GetOSCustomizationSpec

 

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

When you select OSType is 'Linux' the ChangeSID parameter is not allowed.
See the valid parameters in the Linux parameterset for the New-OSCustomizationSpec cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

When you select OSType is 'Linux' the ChangeSID parameter is not allowed.
See the valid parameters in the Linux parameterset for the New-OSCustomizationSpec cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Thank you LucD. That worked 🙂

Tags (1)
0 Kudos