I have a power shell script that invokes a .cmd file. Here the architecture looks like
-PowerShell File Code
$arguments='/savecred /profile /user:myDomain\myuser "cmd /c C:\Users\myuser\code.cmd"' Start-Process cmd.exe $arguments -Wait
- .cmd code file
Here the code invokes wget request to download a file
wget .....(command here)
My goal is to learn at PowerShell command prompt (after completing Start-Process command) whether the wget command executed successfully or some error like 401, 404 occurred during the execution. Here I am particular not interested in the type of error, just need to know whether error occurred or not.