Switch branches/tags
Nothing to show
Find file Copy path
7d2b5b3 Sep 5, 2015
1 contributor

Users who have contributed to this file

56 lines (43 sloc) 1.3 KB
Function New-SCCMTSAppVariable
Function to create a SCCM Task Sequence Application Variable during the OSD
.PARAMETER BaseVariableName
Specifies the "Base Variable Name" present in the task "Install Application" of the Task Sequence.
(In the 'Install application according to dynamic variable list' section)
.PARAMETER ApplicationList
Specifies the list of application to install.
Those must match the SCCM Application name to install
New-SCCMTSVariable -BaseVariableName "FX" -ApplicationList "Photoshop","AutoCad"
New-SCCMTSVariable -BaseVariableName "FX" -ApplicationList $Variable
Francois-Xavier Cat
PARAM ([String]$BaseVariableName,
# Create an TaskSequence Environment Object
$TaskSequenceEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment
# Create a Counter
$Counter = 1
# Foreach Application we create an incremented variable
$ApplicationList | ForEach-Object {
# Define the Variable Name
$Variable = "$BaseVariableName{0:00}" -f $Counter
# Create the Task Sequence Variable
$TaskSequenceEnvironment.value("$Variable") = "$_"
# Increment the counter