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
Implement Invoke-Item for .NET Core on Windows, Nano Server and IoT #2272
To fix this issue, a possible solution is to wrap the call in cmd.exe “start...”; however, in order to figure out if the process fail to start, we need WaitForExit, then check the exit code, and extract the standard error. This is a change on behavior between Full and CoreCLR PowerShell. The problem with this implementation is that PowerShell will be blocked until the process completes. Alternatively, if we decide to just ignore the error, then this behavior will also be incorrect since in PowerShell no error means the operation was successful.
We should explore doing a PInvoke in Windows CoreCLR. This way, we can get the Marshal.GetLastWin32Error() if we fail to start the process.
on Windows Core CLR
invoke-item path_to_file_or_exe
Activity
adityapatwardhan commentedon Sep 19, 2016
Francisco Gamino (@Francisco-Gamino). Please add the PSVersionTable information.
daxian-dbw commentedon Oct 12, 2016
This issue covers the
Invoke-Itempart of the original issue #1325SteveL-MSFT commentedon Nov 4, 2016
This also needs to work on Linux so don't have just a Windows solution
daxian-dbw commentedon Mar 15, 2017
Invoke-Itemalready works on Linux and Mac. On windows,Invoke-Itemwas enabled by adding support toShellExecuteExin powershell core via #3281