PowerTip: Find Case-Specific Strings by Using PowerShell

Doctor Scripto

Dr Scripto

Summary: Use Windows PowerShell to find case-specific strings.

Hey, Scripting Guy! Question How can I find a particular, case-sensitive word in a string?

Hey, Scripting Guy! Answer Use Select-String and specify the –CaseSensitive switch:

“Hey Scripting Guy”,”hey scripting guy” | Select-String -Pattern ‘hey’ -CaseSensitive

Doctor Scripto
Dr Scripto

Scripter, PowerShell, vbScript, BAT, CMD

Follow Dr Scripto   

0 comments

    Leave a comment