Switch Statement with File Parameter
suggest change-File reads the file and tests each line. Matching is case-insensitive unless you also pass -CaseSensitive.
Example file input.txt:
condition
test
Example switch statement:
switch -File input.txt
{
'condition' {'First Action'}
'test' {'Second Action'}
'fail' {'Third Action'}
}
First Action
Second Action
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents