Get-CMConfigurationPlatform
Get an OS platform for a requirement rule.
Syntax
SearchByName (Default)
Get-CMConfigurationPlatform
[[-Name] <String>]
[-Fast]
[-IsSupported <Boolean>]
[-PlatformOption <PlatformType>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
SearchById
Get-CMConfigurationPlatform
[-Id] <Int32>
[-Fast]
[-IsSupported <Boolean>]
[-PlatformOption <PlatformType>]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[<CommonParameters>]
Description
Use this cmdlet to get an OS platform to use with an OS requirement rule for an application deployment type. You can use the output object of this cmdlet with the New-CMRequirementRuleOperatingSystemValue cmdlet.
Note
Run Configuration Manager cmdlets from the Configuration Manager site drive, for example PS XYZ:\>
. For more information, see getting started.
Examples
Example 1: Add a requirement rule for an OS by platform
This example first uses the Get-CMGlobalCondition cmdlet to get the default Operating system global condition for non-mobile Windows devices. It then defines variables for two platforms for Windows Server 2016 and Windows Server 2019. Next it uses the New-CMRequirementRuleOperatingSystemValue cmdlet to create the requirement rule object to include these two platforms. Finally it passes that rule object to the Set-CMScriptDeploymentType cmdlet to add the requirement.
$myGC = Get-CMGlobalCondition -Name "Operating System" | Where-Object PlatformType -eq 1
$platformA = Get-CMConfigurationPlatform -Name "All Windows Server 2019 and higher (64-bit)"
$platformB = Get-CMConfigurationPlatform -Name "All Windows Server 2016 and higher (64-bit)"
$myRule = $myGC | New-CMRequirementRuleOperatingSystemValue -RuleOperator OneOf -Platform $platformA, $platformB
Set-CMScriptDeploymentType -ApplicationName "Central App" -DeploymentTypeName "Install" -AddRequirement $myRule
Parameters
-DisableWildcardHandling
This parameter treats wildcard characters as literal character values. You can't combine it with ForceWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Fast
Add this parameter to not automatically refresh lazy properties. Lazy properties contain values that are relatively inefficient to retrieve. Getting these properties can cause additional network traffic and decrease cmdlet performance.
If you don't use this parameter, the cmdlet displays a warning. To disable this warning, set $CMPSSuppressFastNotUsedCheck = $true
.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-ForceWildcardHandling
This parameter processes wildcard characters and may lead to unexpected behavior (not recommended). You can't combine it with DisableWildcardHandling.
Parameter properties
Type: | SwitchParameter |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Id
Specify the integer value for the CI_ID of the platform. For example, the CI_ID for the platform All Windows Server 2019 and higher (64-bit) is 287650
.
Use a command similar to the following to discover the CI_ID for a platform:
Get-CMConfigurationPlatform -Name "*Server 2019*" | Select-Object LocalizedDisplayName, CI_ID
Parameter properties
Type: | Int32 |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | CI_ID |
Parameter sets
SearchById
Position: | 0 |
Mandatory: | True |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-IsSupported
Configuration Manager still defines legacy platforms for backward compatibility. Set this parameter to $true
to filter the results to only platforms that are currently supported.
Parameter properties
Type: | Boolean |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-Name
Specify the name of the OS platform. You can use wildcard characters:
*
: Multiple characters?
: Single character
Parameter properties
Type: | String |
Default value: | None |
Supports wildcards: | False |
DontShow: | False |
Aliases: | LocalizedDisplayName |
Parameter sets
SearchByName
Position: | 0 |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
-PlatformOption
Use this parameter to filter the results by platform type.
Parameter properties
Type: | PlatformType |
Default value: | None |
Accepted values: | None, Windows, Mobile, Mac, MixedPlatform |
Supports wildcards: | False |
DontShow: | False |
Parameter sets
(All)
Position: | Named |
Mandatory: | False |
Value from pipeline: | False |
Value from pipeline by property name: | False |
Value from remaining arguments: | False |
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Inputs
None
Outputs
IResultObject
IResultObject
Notes
For more information on this return object and its properties, see SMS_ConfigurationPlatform server WMI class.
This cmdlet is different from the similar Get-CMSupportedPlatform cmdlet.