Specify platforms for Software Packages

The platforms supported by a package are mapped as an association between the package and the catalog objects of the platforms. Therefore, you must first retrieve the OperatingSystem objects of the platforms you want to support, and then create a new association of type "SoftwareOS" for each platform.


Examples:


Hint: The execution of these examples requires a connected PowerShell drive.


The following example first retrieves the software package "Adobe Reader 9.0" and the OperatingSystem object "Windows 10 (x64)" and then creates the association that ensures that this package is supported by the 64-bit version of Windows 10:


$MySwPackage = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Application Library\Adobe\Adobe Reader\Adobe Reader 9.0"

$MyPlatform = Get-EmdbItem emdb:\rootCatalog -SchemaTag OperatingSystem -Filter "(Name=Windows 10 \(x64\))"

$MyPackagePlatform = $MySwPackage.NewAssociation($MyPlatform, "SoftwareOS")

$MyPackagePlatform.Create()


Hint: In the Name property of the example above for "Windows 10 (x64)", round brackets are included, which lead to an error in the filter parser without special handling. These must therefore be escaped by a backslash.