Adding platforms

Adds one or more supported platforms to a software package.


Examples:


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


The following example adds the platform "Windows 11 (x64)" to the software package "Teams 1.6.0.9372":


$MySoftware = Get-EmdbSoftwarePackage "emdb:\rootDSE\Global Software Library\Application Library\Microsoft\Teams 1.6.0.9372"

Add-EmdbSoftwarePlatform -Software $MySoftware -Platform "Windows 11 (x64)"


To assign support for both 32- and 64-bit Windows 10 platforms to the same software package, you can work with wildcards:


Add-EmdbSoftwarePlatform -Software $MySoftware -Platform "Windows 10*"


To add the "Windows 11 (x64)" platform to all eScript and MSI software packages that did not support it before, you can use the following code:


Get-EmdbSoftwarePackage -Path "emdb:\" -Filter "(SchemaTag:ContainedIn='MsiPackage','eScriptPackage')" -Recurse | Where-Object {-not (Test-EmdbSoftwarePlatform -Software $_ -Platform "Windows 11 (x64)")} | Add-EmdbSoftwarePlatform -Platform "Windows 11 (x64)"


The NoDuplicates switch eliminates the need to check or filter packets that already have destination platforms assigned to them:


Get-EmdbSoftwarePackage -Path "emdb:\" -Filter "(SchemaTag:ContainedIn='MsiPackage','eScriptPackage')" -Recurse | Add-EmdbSoftwarePlatform -Platform "Windows 11 (x64)" -NoDuplicates