You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Should native command errors have the executable path or invocation as the TargetObject instead of the name? #15992
I think we brought this up in an engine working group meeting when we were discussing Keith Hill (@rkeithhill)'s PR a handful of weeks ago.
From memory, the main points raised were:
Extra information would be good, but we'd need to be careful that we aren't leaking secrets/sensitive input in this way (e.g., from command line args)
The process ID probably isn't going to be of great use since this exception is thrown after the executable exits.
Keith might have more complete notes, I think he was taking notes then.
I think it's probably reasonably safe to have the process object itself be the target object? I don't think any really sensitive information would be left on the process object unless you can access the startinfo from there.
We discussed adding the arguments and/or command line as another property on the exception - in addition to Path, ProcessId and ExitCode. But we decided that was dangerous because it might show api keys/tokens. I vote for just including the full path to the executable.
I think we brought this up in an engine working group meeting when we were discussing Keith Hill (@rkeithhill)'s PR a handful of weeks ago.
Yeah, we decided on what should be on the actual exception. I just wanted to see what the ideal TargetObject for the error record should be, in terms of information, consistency and discoverability.
Activity
vexx32 commentedon Aug 24, 2021
I think we brought this up in an engine working group meeting when we were discussing Keith Hill (@rkeithhill)'s PR a handful of weeks ago.
From memory, the main points raised were:
Keith might have more complete notes, I think he was taking notes then.
I think it's probably reasonably safe to have the process object itself be the target object? I don't think any really sensitive information would be left on the process object unless you can access the startinfo from there.
rkeithhill commentedon Aug 24, 2021
We discussed adding the arguments and/or command line as another property on the exception - in addition to Path, ProcessId and ExitCode. But we decided that was dangerous because it might show api keys/tokens. I vote for just including the full path to the executable.
rkeithhill commentedon Aug 24, 2021
You can:
rjmholt commentedon Aug 25, 2021
Yeah, we decided on what should be on the actual exception. I just wanted to see what the ideal
TargetObjectfor the error record should be, in terms of information, consistency and discoverability.Specify exe path as TargetObect for non-zero exit code ErrorRecord