Set-ASAppModelData
Edition:Powershell cmdlets are enabled with AdminStudio Enterprise Edition.
You can use the Set-ASAppModelData cmdlet to add and update the different App Model Data for a package.
Examples
The following is an example of the Set-ASAppModelData cmdlet:
Set-ASAppModelData -PackageId 1 -Type DataContingencies -XmlPath 'C:\Users\Administrator\Desktop\AddCriteria.xml'
Set-ASAppModelData -PackageId 1 -Type Requirement -XmlPath 'C:\Users\Administrator\Desktop\AddAdditionalRequirements.xml -DistributionSystem Intunewin'
Example of Data Contingencies and Define Criteria for “Application, File, and Registry” Types:
‘<Criteria>
<AirwatchApplicationRuleHelper>
<CriteriaId>0</CriteriaId>
<CriteriaType>App Exists</CriteriaType>
<Connector>AND</Connector>
<Identifier>Test</Identifier>
<VersionOperator>EqualTo</VersionOperator>
<Value>1.0.0.0</Value>
</AirwatchApplicationRuleHelper>
<AirwatchFileSystemRuleHelper>
<CriteriaId>0</CriteriaId>
<CriteriaType>file exists</CriteriaType>
<Connector>AND</Connector>
<FilePath>C:</FilePath>
<VersionOperator>EqualTo</VersionOperator>
<Value>1.0.0.0</Value>
<ModifiedTime>12:10 AM</ModifiedTime>
<ModifiedDate>08/25/2024</ModifiedDate>
</AirwatchFileSystemRuleHelper>
<AirwatchRegistryRuleHelper>
<CriteriaId>0</CriteriaId>
<CriteriaType>Registry Exists</CriteriaType>
<Connector>OR</Connector>
<Hive>HKEY_LOCAL_MACHINE</Hive>
<HiveKey>hiveKeyyyy</HiveKey>
<ValueName>testpower1</ValueName>
<ValueType>Version</ValueType>
<ValueOperator>NotEqualTo</ValueOperator>
<Value>3.0.0.0</Value>
</AirwatchRegistryRuleHelper>
</Criteria>
Example: XML format for Registry Criteria > MultiString:
<Criteria>
<AirwatchRegistryRuleHelper>
<Hive>HKEY_LOCAL_MACHINE</Hive>
<HiveKey>hiveKey</HiveKey>
<ValueName>testpower1</ValueName>
<ValueType>Multi-String</ValueType>
<ValueOperator>NotEqualTo</ValueOperator>
<CriteriaType>Registry Exists</CriteriaType>
<Connector>OR</Connector>
<Value>2.2.2.2</Value>
<MultiStringValue>MultiStringValue</MultiStringValue>
<CriteriaId>0</CriteriaId>
</AirwatchRegistryRuleHelper>
</Criteria>
Note:If the CriteriaId in the XML is set 0, then a new criteria will be added. If the criteria is set to an existing CriteriaId, then the existing criteria will be updated.
Set-ASAppModelData Parameters
Parameter |
Description |
||||||||||||||||||||||||
PackageId |
Specifies the package Id for the package. |
||||||||||||||||||||||||
Type |
Select one of the following pre-defined set of values:
|
||||||||||||||||||||||||
XML |
It accepts XML as input parameter. |
||||||||||||||||||||||||
DistributionSystem |
Select one of the following from the pre-defined set of values:
Note:Only Additional Requirements will be added for the Intunewin packages. |
Return Values
Returns CriteriaId’s and status value as Succeeded.
Example:
Status: Succeeded
CriteriaIDs: 438, 439, 440