Andrew,

 

Global Conditions are more than merely true/false statements. You can
perform a value comparison in addition to performing existential
comparisons.

 

For example, let's say that the PowerShell script in a Global Condition
contained the following code:

 

(Get-Process).Name; 

 

This script / command would return an array of String objects. When you use
the Global Condition on a Deployment Type, you could use the "contains"
operator to check that the array "contains" "notepad."

 

In PowerShell lingo, this would look like this:

 

(Get-Process).Name -contains 'notepad'; 

 

Cheers,

Trevor Sullivan

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Andrew Craig
Sent: Thursday, March 13, 2014 9:42 AM
To: [email protected]
Subject: RE: [mssms] VOTE: ConfigMgr 2012: Script-based Global Conditions
should return arrays

 

Hi Trevor,

Sorry, I don't get why you would want to return an array. You evaluate a
condition to be true or false so even if you really did have an array from
the script logic you could evaluate this array in the script and then return
true or false. To return an array to the condition, does that not mean that
a condition could be kinda compliant or sorta non-compliant?

Not being flippant, just can't picture a use case. 

Andy

 

From: [email protected] <mailto:[email protected]>
[mailto:[email protected]] On Behalf Of Trevor Sullivan
Sent: 13 March 2014 15:17
To: [email protected] <mailto:[email protected]> 
Subject: [mssms] VOTE: ConfigMgr 2012: Script-based Global Conditions should
return arrays

 

Folks,

 

For anyone who is using PowerShell scripts within custom Global Conditions,
please review this bug and vote on it:

 

 
<https://connect.microsoft.com/ConfigurationManagervnext/feedback/details/83
2849/dcr-script-based-global-conditions-should-be-able-to-return-arrays>
https://connect.microsoft.com/ConfigurationManagervnext/feedback/details/832
849/dcr-script-based-global-conditions-should-be-able-to-return-arrays

 

There are ways to work around this by joining an array of strings into a
singleton object, but being able to return object arrays from a PowerShell
script would be very useful.

 

Cheers,

Trevor Sullivan

 

 



Reply via email to