powershell "&{if ('%USERNAME%' -eq 'LARRY') {echo 'Larry'} else {echo 'not
Larry'}}" >xo
as a starting point. At least PowerShell stays away from the redirection
characters in defining the comparison operators. That makes it a bit easier to
generate PowerShell from a batch script.
You can also execute the PowerShell logic from a PowerShell script file
powershell -File myscript.ps1 >xo
- Larry
Pure batch files do not rely on redirection characters either for their
comparison operators:
EQU - equal
NEQ - not equal
LSS - less than
LEQ - less than or equal
GTR - greater than
GEQ - greater than or equal
I was specifically contrasting embedding PowerShell scripts in batch files to
embedding, say, AWK scripts in batch files, where AWK uses the > < characters as
the comparison operators.
- Larry