Powershell: how to check if string contains any significant characters?

Question:

I need to check a string to see if it conatins anything other than spaces, returns, etc.

In perl, I used:

How do I do that in PowerShell?

Answer:

Use the -match operator:

Also check the online docs for comparison operators: http://technet.microsoft.com/en-us/library/hh847759.aspx

Source:

Powershell: how to check if string contains any significant characters? by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply