MicrosoftDocs / sccm-docs-powershell-ref

Configuration Manager PowerShell documentation public repo
https://docs.microsoft.com/powershell/sccm/configurationmanager/
Creative Commons Attribution 4.0 International
26 stars 61 forks source link

Possible bug or something wrong with New-CMRequirementRuleOperatingSystemValue Description #241

Closed boozeman closed 2 years ago

boozeman commented 2 years ago

In the New-CMRequirementRuleOperatingSystemValue description says that the -PlatformString used with CI_ID but you actually have to use ModelName on it.

We can get modelnames it like this: Get-CMConfigurationPlatform -Name "Windows 1" | Select-Object LocalizedDisplayName,ModelName

And then use like this:

$myGC = Get-CMGlobalCondition -Name "Operating System" | Where-Object PlatformType -eq 1 $myRule = $myGC | New-CMRequirementRuleOperatingSystemValue -RuleOperator OneOf -PlatformString "Windows/All_x64_Windows_10_and_higher_Clients","Windows/All_x64_Windows_11_and_higher_Clients"

This was the only way to got it work properly. Is this error or am I missing something?

MECM tested with this is version 2107


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

aczechowski commented 2 years ago

Thanks @boozeman for the feedback! I thought I had tested that option, but I can reproduce your results now. I'm updating the article with a big refresh I'm working on. Thanks again