Having a problem using the pipeline with all the available parameters for new-customizationspec. Here's an example.
Powercli v 5.8
Example. If I have an OScustomizationspec called "auto_linux", I can do the following no problem:
$oscust = Get-OSCustomizationSpec auto_linux | New-OSCustomizationSpec -name custom_auto_linux
However, if I try to add parameters available to the New-OSCustomizationSpec, it fails. Example:
$oscust = Get-OSCustomizationSpec auto_linux | New-OSCustomizationSpec -name custom_auto_linux -ostype linux -dnssuffix mydomain.domain.com
Running that gives me the following error:
New-OSCustomizationSpec : The input object cannot be bound to any parameters
for the command either because the command does not take pipeline input or the
input and its properties do not match any of the parameters that take pipeline
input.
I have no idea what's going on here or why that's failing. I used the parameters from the PowerCLI 5.8 cmdlet docs. Is it requiring other parameters to work? If so I can't find docs on that. Here's the link to the doc:
The New-OSCustomizationSpec cmdlet has several parametersets.
One is to clone an existing OSCustomizationSpec (your first line), another is one where you specify all the parameters that need to be set in the OSCustomizationSpec.
You can not use parameters from different parametersets together.
The solution is to clone the OSCustomizatoinSpec, and then use the Set-OSCustomizationSpec cmdlet to change specific settings.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
The New-OSCustomizationSpec cmdlet has several parametersets.
One is to clone an existing OSCustomizationSpec (your first line), another is one where you specify all the parameters that need to be set in the OSCustomizationSpec.
You can not use parameters from different parametersets together.
The solution is to clone the OSCustomizatoinSpec, and then use the Set-OSCustomizationSpec cmdlet to change specific settings.
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference