File tree 1 file changed +49
-0
lines changed
SCCM-New-SCCMTSAppVariable
1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ Function New-SCCMTSAppVariable
2
+ {
3
+ <#
4
+ . SYNOPSIS
5
+ Function to create a SCCM Task Sequence Application Variable during the OSD
6
+
7
+ . PARAMETER BaseVariableName
8
+ Specifies the "Base Variable Name" present in the task "Install Application" of the Task Sequence.
9
+ (In the 'Install application according to dynamic variable list' section)
10
+
11
+ . PARAMETER ApplicationList
12
+ Specifies the list of application to install.
13
+ Those must match the SCCM Application name to install
14
+
15
+ . EXAMPLE
16
+ New-SCCMTSVariable -BaseVariableName "FX" -ApplicationList "Photoshop","AutoCad"
17
+
18
+ . EXAMPLE
19
+ New-SCCMTSVariable -BaseVariableName "FX" -ApplicationList $Variable
20
+
21
+ . NOTES
22
+ Francois-Xavier Cat
23
+ www.lazywinadmin.com
24
+ @lazywinadm
25
+ #>
26
+
27
+ PARAM ([String ]$BaseVariableName ,
28
+
29
+ [String []]$ApplicationList
30
+ )
31
+
32
+ BEGIN
33
+ {
34
+ $TSEnv = New-Object - COMObject Microsoft.SMS.TSEnvironment
35
+ }
36
+ PROCESS
37
+ {
38
+
39
+ $ApplicationCount = $ApplicationList.Count
40
+ $Counter = 1
41
+
42
+ $ApplicationList | ForEach-Object {
43
+ $Variable = " $BaseVariableName {0:00}" -f $Counter
44
+ $TSEnv.value (" $Variable " ) = " $_ "
45
+
46
+ $Counter ++ | Out-Null
47
+ }
48
+ }
49
+ }
You can’t perform that action at this time.
0 commit comments