Add-CMComplianceSettingScript
語法
Add-CMComplianceSettingScript
-DataType <SettingDataType>
[-DiscoveryScriptFile <String>]
-DiscoveryScriptLanguage <ScriptingLanguage>
[-DiscoveryScriptText <String>]
[-Is64Bit]
[-IsPerUser]
[-Remediate]
[-RemediationScriptFile <String>]
[-RemediationScriptLanguage <ScriptingLanguage>]
[-RemediationScriptText <String>]
[-Description <String>]
-InputObject <PSObject>
-Name <String>
[-NoRule]
[-PassThru]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-CMComplianceSettingScript
-DataType <SettingDataType>
[-DiscoveryScriptFile <String>]
-DiscoveryScriptLanguage <ScriptingLanguage>
[-DiscoveryScriptText <String>]
[-Is64Bit]
[-IsPerUser]
[-Remediate]
[-RemediationScriptFile <String>]
[-RemediationScriptLanguage <ScriptingLanguage>]
[-RemediationScriptText <String>]
[-Description <String>]
-Existence <ExistenceType>
[-ExistentialRule]
[-ExpectedValue <String[]>]
[-ExpressionOperator <RuleExpressionOperator>]
-InputObject <PSObject>
-Name <String>
[-NoncomplianceSeverity <NoncomplianceSeverity>]
[-PassThru]
[-RuleDescription <String>]
-RuleName <String>
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Add-CMComplianceSettingScript
-DataType <SettingDataType>
[-DiscoveryScriptFile <String>]
-DiscoveryScriptLanguage <ScriptingLanguage>
[-DiscoveryScriptText <String>]
[-Is64Bit]
[-IsPerUser]
[-Remediate]
[-RemediationScriptFile <String>]
[-RemediationScriptLanguage <ScriptingLanguage>]
[-RemediationScriptText <String>]
[-Description <String>]
-ExpectedValue <String[]>
-ExpressionOperator <RuleExpressionOperator>
-InputObject <PSObject>
-Name <String>
[-NoncomplianceSeverity <NoncomplianceSeverity>]
[-PassThru]
[-ReportNoncompliance]
[-RuleDescription <String>]
-RuleName <String>
[-ValueRule]
[-DisableWildcardHandling]
[-ForceWildcardHandling]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
注意事項
從 Configuration Manager 月臺磁碟驅動器執行 Configuration Manager Cmdlet,例如 PS XYZ:\>
。 如需詳細資訊,請 參閱開始使用。
範例
範例 1
Add-CMComplianceSettingScript -InputObject $ci -DiscoveryScriptLanguage PowerShell -DataType String -Name "test1" -DiscoveryScriptText "test" -RemediationScriptLanguage PowerShell -RemediationScriptText "test" -RuleName rule1 -ExpressionOperator IsEquals -ValueRule -ExpectedValue 1.0 -Remediate
參數
-Confirm
執行 Cmdlet 之前提示您確認。
類型: | SwitchParameter |
別名: | cf |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DataType
類型: | SettingDataType |
接受的值: | String, DateTime, Integer, FloatingPoint, Version, Boolean |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-Description
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DisableWildcardHandling
此參數會將通配符視為常值字元值。 您無法將其與 ForceWildcardHandling 結合。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DiscoveryScriptFile
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-DiscoveryScriptLanguage
類型: | ScriptingLanguage |
接受的值: | PowerShell, VBScript, JScript, ShellScript |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-DiscoveryScriptText
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Existence
類型: | ExistenceType |
接受的值: | MustExist, MustNotExist, Occurs |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ExistentialRule
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ExpectedValue
類型: | String[] |
別名: | ExpectedValues, ExpectedCount, ExpectedCounts |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ExpressionOperator
類型: | RuleExpressionOperator |
接受的值: | And, Or, Other, IsEquals, NotEquals, GreaterThan, LessThan, Between, NotBetween, GreaterEquals, LessEquals, BeginsWith, NotBeginsWith, EndsWith, NotEndsWith, Contains, NotContains, AllOf, OneOf, NoneOf, SetEquals, SubsetOf, ExcludesAll, And, Or, Other, IsEquals, NotEquals, GreaterThan, LessThan, Between, NotBetween, GreaterEquals, LessEquals, BeginsWith, NotBeginsWith, EndsWith, NotEndsWith, Contains, NotContains, AllOf, OneOf, NoneOf, SetEquals, SubsetOf, ExcludesAll |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ForceWildcardHandling
此參數會處理通配符,並可能導致非預期的行為 (不建議) 。 您無法將其與 DisableWildcardHandling 結合。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
類型: | PSObject |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-Is64Bit
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-IsPerUser
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Name
類型: | String |
別名: | SettingName |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-NoncomplianceSeverity
類型: | NoncomplianceSeverity |
接受的值: | None, Informational, Warning, Critical, CriticalWithEvent |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-NoRule
類型: | SwitchParameter |
別名: | NoRules |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-PassThru
傳回 物件,表示您正在使用的專案。 根據預設,此 Cmdlet 可能不會產生任何輸出。
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
類型: | ScriptingLanguage |
接受的值: | PowerShell, VBScript, JScript, ShellScript |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-RemediationScriptText
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ReportNoncompliance
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-RuleDescription
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-RuleName
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ValueRule
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-WhatIf
顯示執行 Cmdlet 時會發生什麼情況。 Cmdlet 不會執行。
類型: | SwitchParameter |
別名: | wi |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
System.Management.Automation.PSObject
輸出
System.Object