We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2c3b3ff commit 7d2b5b3Copy full SHA for 7d2b5b3
SCCM-New-SCCMTSAppVariable/New-SCCMTSAppVariable.ps1
@@ -31,19 +31,26 @@
31
32
BEGIN
33
{
34
- $TSEnv = New-Object -COMObject Microsoft.SMS.TSEnvironment
+ # Create an TaskSequence Environment Object
35
+ $TaskSequenceEnvironment = New-Object -COMObject Microsoft.SMS.TSEnvironment
36
}
37
PROCESS
38
39
- $ApplicationCount = $ApplicationList.Count
40
+ # Create a Counter
41
$Counter = 1
42
43
+ # Foreach Application we create an incremented variable
44
$ApplicationList | ForEach-Object {
45
+
46
+ # Define the Variable Name
47
$Variable = "$BaseVariableName{0:00}" -f $Counter
- $TSEnv.value("$Variable") = "$_"
48
- $Counter++| Out-Null
49
+ # Create the Task Sequence Variable
50
+ $TaskSequenceEnvironment.value("$Variable") = "$_"
51
52
+ # Increment the counter
53
+ [void]$Counter++
54
55
56
0 commit comments