Powershell cmdlet for adding global conditions as requirements
We are using PowerShell as a frontend for creating applications. As default we create multiple deployment type, each of them intented to run in certain environemts. These environemts are defined in some custom global conditions.
When creating the deployment type we can very easily identify which global contitions shold be set as requirement. But we miss a Powershell cmdlet to automize this task. Instead we rely on the application creator to remember to add these conditions.
So far I have found a PS-script that can add one of the build-in conditions, but it fails when trying to add a custom made condition.
Thanks for the suggestion. This is something we plan to address in a future release.
any update regarding to this?
Could you please let us know if the feature asked by Mads Nyberg has been addressed or not.
If yes, please provide us the reference link or notes to move further. Why because we are automating the SCCM application deployment process through powershell but no where i could be able to find out the powershell script for adding Custom made requirement condition in an Application deployment type.
Alexander Hefele commented
Hi @Adam Meltzer,
as there is a Get-CMGlobalCondition cmdlet maybe it is a good Idea only add a "Rule" Property for this cmdlet
On the current Set-CMDeploymentType cmdlet there is the ability to add a Requirenment by -AddRequirement an the type "Rule" is recommenden (a DCM-Rule as i know).
If you add this type to Get-CMGlobalCondition we can use it like:
$condition = Get-CMGlobalCondition -Name "TestCondition"
Set-CMDeploymentType -ApplicationName "TestApplication" -AddRequirement $condition.Rule