Hello,
I've written some scripts to execute over PSEXEC, I can get the Appcmd / Batch file to execute correctly over multiple lines, but when running in a single line I'm finding that appcmd is attempting to process the entire line of code, even when using & to attempt and break the commands.
Working Code
APPCMD LIST APPPOOL /name:$=*100* IF %ERRORLEVEL% EQU 0 ( ECHO We found it! ) ELSE ( ECHO We Don't Have it! )
Failing Code
APPCMD LIST APPPOOL "/name:'$=*100*'" & IF %ERRORLEVEL% EQU 0 (ECHO We found it!) ELSE (ECHO We Don't Have it!)
The above failing code always returns the first echo, no matter if the value is correct or not.