I have got some trouble with the switch statement because I have to check log statements from a logfile.
The statements could be for example:
cvs [update aborted]: no such user XYZ
cvs update: cannot open XYZ
cvs update: No CVSROOT specified!
In the real logfile XYZ is changed by a file- or directory name.
I'm looking for a simple switch statement for checking the logfile string. My problem is the wildcard symbol "?" that is included in one logfile statement. When I use the -wildcard option for the last 4 examples are the same for powershell.
If the problem is, that the shell takes "?" as a wildcard, but you want it to be a literal "?", you can use the escape character, which is a bactick, just before the "?". Like this: `?
This way, the shell wont treat "?" as awildcard.
Is this what you mean?