Repository navigation
Invoke-Item - #1220
Invoke-Item #1220
Conversation
There was a problem hiding this comment.
What the heck happened here?
There was a problem hiding this comment.
I'm thinking a botched VSCode save...
Cosmetic change.
|
Waiting on process fix for AppVeyor to pass. |
a5bcbab to
fd7a167
Compare
|
Set the Pester tests to be $Pending:IsWindows. Testing on windows uncovered invoke-item was broken on all platforms, including windows. Linux and OSX are fixed. |
|
|
||
| It "Should invoke a text file without error" -Pending:$IsWindows { | ||
| $debugfn = NewProcessStartInfo "-noprofile ""``Invoke-Item $FullyQualifiedFile`n" -RedirectStdIn | ||
| $process = RunPowerShell $debugfn |
There was a problem hiding this comment.
Do you need to launch a whole new PowerShell process for this? Can't you just launch Invoke-Item and check that it didn't throw?
There was a problem hiding this comment.
Synced offline: II was failing silently on Linux with defunct threads, which would cause the host process to exit with an error code. This is the correct test.
|
|
||
| if (ShouldProcess(resource, action)) | ||
| { | ||
| System.Diagnostics.Process invokeProcess = new System.Diagnostics.Process(); |
There was a problem hiding this comment.
This disappeared.
|
LGTM. |
| invokeProcess.StartInfo.Arguments = path; | ||
| } | ||
|
|
||
| invokeProcess.Start(); |
There was a problem hiding this comment.
Could you double check to make sure that on windows system, there is no two processes launched for invoke-item? Thanks.
There was a problem hiding this comment.
This PR is very old and this code has since been rewritten due to this not being supported on Windows at all. See #1325.
Invoke-Item fix for Linux and OSX.
Resolves #974 - Invoke-Item doesn't do anything. Also added a test to at least verify invoke-item can exit successfully.