I want to run a PowerShell command (not script) from a cmd.exe and manage the exit code properly:
powershell.exe [bool]((get-service wsearch).status -eq 'Running')
But I would like to return the boolean status as the error level.
I would like to echo %errorlevel% after running it and use it to determine service status.