1 year ago
#238224
ondister
How to use wildcard string as directory name in PowerShell's Add-CMComplianceSettingDirectory?
I try to invoke Add-CMComplianceSettingDirectory cmdlet from ConfigurationManager.psd1 module.
$ConfigurationItem | Add-CMComplianceSettingDirectory -Name "CV" -DirectoryName "*DDD" -Path "c:\" -NoRule -DisableWildcardHandling
But I just have the System.Management.Automation.ValidationMetadataException: Cannot validate argument on parameter 'DirectoryName'.
I assume it's just trying to process the wildcard character, but the DirectoryName parameter doesn't allow the wildcard. And I have no idea how to write directory name with wildcard to the string.
powershell
sccm
0 Answers
Your Answer