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

Bad Examples #239

Closed gwblok closed 2 years ago

gwblok commented 2 years ago

[Enter feedback here] The examples on this page are incorrect. You can't actually do them.

I'm having an issue trying to figure out how to add a Configuration Item into a Baseline.


Document Details

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

aczechowski commented 2 years ago

Hi @gwblok sorry you're having trouble. I haven't dug into this myself, but here's an example from one of our test systems, if it helps at least get things started? Let me know, and I can look at revising these examples at the next updates for 2111 CB.

$objPSTestWinAppCI = Get-CMConfigurationItem -Name PSTestWinAppCI
$objPSTestWinAppCI2 = Get-CMConfigurationItem -Name PSTestWinAppCI2
$objPSTestWinOSCI = Get-CMConfigurationItem -Name PSTestWinOSCI
$objPSTestWinAppCI3 = Get-CMConfigurationItem -Name PSTestWinAppCI3
$objPSTestWinAppCI4 = Get-CMConfigurationItem -Name PSTestWinAppCI4
$objPSTestMDCI = Get-CMConfigurationItem -Name PSTestMDCI
$objPSTestMacCI = Get-CMConfigurationItem -Name PSTestMacCI
Set-CMBaseline -Name PSTestBaseLine -NewName PSTestBaseLineNew -Description "DCM Testing New" -RemoveCategory ("IT Infrastructure") -AddRequiredConfigurationItems ($objPSTestWinAppCI4.CI_ID,$objPSTestMDCI.CI_ID) -AddProhibitedConfigurationItems ($objPSTestWinAppCI.CI_ID) -AddOSConfigurationItems ($objPSTestWinOSCI.CI_ID,$objPSTestMacCI.CI_ID) -AddOptionalConfigurationItems ($objPSTestWinAppCI2.CI_ID,$objPSTestWinAppCI3.CI_ID) -WhatIf
gwblok commented 2 years ago

Thanks for getting back to me Eventually I did figure out how to get it to work, and I did submit a new example

On Fri, Oct 8, 2021, 6:06 PM Aaron Czechowski @.***> wrote:

Hi @gwblok https://github.com/gwblok sorry you're having trouble. I haven't dug into this myself, but here's an example from one of our test systems, if it helps at least get things started? Let me know, and I can look at revising these examples at the next updates for 2111 CB.

$objPSTestWinAppCI = Get-CMConfigurationItem -Name PSTestWinAppCI$objPSTestWinAppCI2 = Get-CMConfigurationItem -Name PSTestWinAppCI2$objPSTestWinOSCI = Get-CMConfigurationItem -Name PSTestWinOSCI$objPSTestWinAppCI3 = Get-CMConfigurationItem -Name PSTestWinAppCI3$objPSTestWinAppCI4 = Get-CMConfigurationItem -Name PSTestWinAppCI4$objPSTestMDCI = Get-CMConfigurationItem -Name PSTestMDCI$objPSTestMacCI = Get-CMConfigurationItem -Name PSTestMacCISet-CMBaseline -Name PSTestBaseLine -NewName PSTestBaseLineNew -Description "DCM Testing New" -RemoveCategory ("IT Infrastructure") -AddRequiredConfigurationItems ($objPSTestWinAppCI4.CI_ID,$objPSTestMDCI.CI_ID) -AddProhibitedConfigurationItems ($objPSTestWinAppCI.CI_ID) -AddOSConfigurationItems ($objPSTestWinOSCI.CI_ID,$objPSTestMacCI.CI_ID) -AddOptionalConfigurationItems ($objPSTestWinAppCI2.CI_ID,$objPSTestWinAppCI3.CI_ID) -WhatIf

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/issues/239#issuecomment-939159624, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIX45ISPTJCE4C6ZRXM6YDUF52QVANCNFSM5FURFBNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

aczechowski commented 2 years ago

I updated this article (and all *-CMBaseline articles) with better examples, proper descriptions, and general review. FYI, I didn't see your contribution for an example on this one, but will happily help get it added as always! 😄

gwblok commented 2 years ago

Thank you!

On Mon, Jan 3, 2022, 4:43 PM Aaron Czechowski @.***> wrote:

Closed #239 https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/issues/239.

— Reply to this email directly, view it on GitHub https://github.com/MicrosoftDocs/sccm-docs-powershell-ref/issues/239#event-5837466905, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGIX45KRP4ANJNMLJG5IYHTUUIRCDANCNFSM5FURFBNQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: <MicrosoftDocs/sccm-docs-powershell-ref/issue/239/issue_event/5837466905@ github.com>