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
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
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
Thank you LucD. That worked 🙂