Summary: Use Windows PowerShell to determine if a string contains a wildcard character.
How can I use Windows PowerShell to determine if a string contains a wildcard character?
Use the static ContainsWildcardCharacters method from the System.Management.Automation.WildcardPattern
.NET Framework class, for example:
PS C:\> $wc = '*'
PS C:\> $wc
*
PS C:\> [System.Management.Automation.WildcardPattern]::ContainsWildcardCharacters($wc)
True
0 comments