My ps script has the following code:
$WProcess = Start-Process java -ArgumentList "-jar $AgentFile -c $ConfigFile" -RedirectStandardOutput "$consoleOutPath" -RedirectStandardError "$consoleErrPath" -WindowStyle Hidden -Wait -PassThru
I later inspect $WProcess value, as well as validate $consoleOutPath file and $consoleErrPath, which are files.
How can I mock this as I don’t want to actually run the java program? I would like to mock the return value, as well as what gets written to the console.out and console.err files.
Thank you, ahead of time!