Good morning.
I'm writing a PowerShell script to automate setting up boot images in SCCM
(1511) and I have everything working great up to trying to add some optional
components.
When I use: Get-CMBootImage -Name "Test Boot Image"
I get this result:
OptionalComponents : {18, 19, 24, 26}
This translates to "Scripting (WinPE-Scripting)", "Startup
(WinPE-SecureStartup)", "Network (WinPE-WDS-Tools)", and "Scripting
(WinPE-WMI)". How they line up I don't know.
I want to add "HTML (WinPE-HTA)" for example. That is number 10 (I added it
manually and used the Get-CMBootImage command above to get the results).
OptionalComponents : {10, 18, 19, 24...}
I try: Set-CMBootImage -Name "Test Boot Image 2" -AddOptionalComponent 10
But that fails.
Set-CMBootImage : Cannot bind parameter 'AddOptionalComponent'. Cannot convert
the "10" value of type "System.Int32" to type
"Microsoft.ConfigurationManagement.ManagementProvider.IResultObject".
How is this parameter supposed to work? I cannot find any examples of it
anywhere or documentation on how it is supposed to be used. How do I "cast"
the values I need as
"Microsoft.ConfigurationManagement.ManagementProvider.IResultObject"?
Thanks
Mike Marable
Microsoft Systems Engineer Lead
Enterprise Device Engineering and Management
MCPS, MCITP, MCTS, MCSA, MCSE, MS
[Profile<http://www.mycertprofile.com/Profile/5319166625>]
[Blog<http://thesystemsmonkey.wordpress.com/>]
----------------------------------------------------
"It is better to be prepared for an opportunity and not have one than to have
an opportunity and not be prepared."
- Whitney Young, Jr.
"To do anything worthwhile in life you have got to be hungry."
- Les Brown
**********************************************************
Electronic Mail is not secure, may not be read every day, and should not be
used for urgent or sensitive issues