IN VBScript, just use ListItem:


<job id="Example">

       <script language="VBScript" src="ZTIUtility.vbs"/>

       <script language="VBScript">

 

       dim aStrings, sItem

 

       ' Generate an Array

       aStrings = array ( "Hello", "World" )

 

       oEnvironment.ListItem("ADsecurityGroups") = aStrings

 

       for each sitem in oEnvironment.ListItem("ADsecurityGroups")

              oLogging.CreateEntry "Item " & sItem , LogTypeInfo

       next

 

       </script>

</job>

 

 

In Powershell, if you are running within the powershell MDT Host, use the
$TSEnvList item.

 

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Miller, Todd
Sent: Tuesday, July 29, 2014 2:34 PM
To: [email protected]
Subject: [MDT-OSD] OSD Variables as List

 

I would like to convert an array of Strings into an MDT/OSD oEnvironment
variable list.

 

 

Let's say I have an array of strings  ADSecurityGroups like
ADSecurityGroup[1] = "Group1" ADSecurityGroup[2] = "Group2" and so on

I would like to write a script that will convert the array into a list style
OSD variable

 

or can I just (pseudocode) .

 

For I = 1 to count of objects in ADSecurityGroups

                oEnvironment.Item("ADsecurityGroups00" & Sctr(i)) =
ADSecurityGroups[i]

next i

 

 

Is there something special about Lists vs. regular variables?

 

Maybe someone already has a VBScript written that will convert an array to a
OSD Variable list?

 

  _____  

Notice: This UI Health Care e-mail (including attachments) is covered by the
Electronic Communications Privacy Act, 18 U.S.C. 2510-2521, is confidential
and may be legally privileged.  If you are not the intended recipient, you
are hereby notified that any retention, dissemination, distribution, or
copying of this communication is strictly prohibited.  Please reply to the
sender that you have received the message in error, then delete it.  Thank
you. 

  _____  


Reply via email to