I can not get a powershell script to execute a bat file directly. For example, this works on the command line:
.\\\\my-app\\my-fle.bat
When
Assuming my-app is a subdirectory under the current directory. The $LASTEXITCODE should be there from the last command:
.\my-app\my-fle.bat
If it was from a fileshare:
\\server\my-file.bat