Skip to content

Invoke-Item - #1220

Merged
A (ealexjordan) merged 9 commits into
masterfrom
invokeitem
Jul 6, 2016
Merged

A (ealexjordan) merged 9 commits into
masterfrom
invokeitem

Conversation

@ealexjordan

Copy link
Copy Markdown
Contributor

Resolves #974 - Invoke-Item doesn't do anything. Also added a test to at least verify invoke-item can exit successfully.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What the heck happened here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking a botched VSCode save...

@ealexjordan

Copy link
Copy Markdown
Contributor Author

Waiting on process fix for AppVeyor to pass.

@ealexjordan

Copy link
Copy Markdown
Contributor Author

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

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This disappeared.

@andyleejordan

Copy link
Copy Markdown
Member

LGTM.

@ealexjordan
A (ealexjordan) merged commit cc6dd39 into master Jul 6, 2016
@andyleejordan
Andy Jordan (andyleejordan) deleted the invokeitem branch July 6, 2016 17:53
invokeProcess.StartInfo.Arguments = path;
}

invokeProcess.Start();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you double check to make sure that on windows system, there is no two processes launched for invoke-item? Thanks.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is very old and this code has since been rewritten due to this not being supported on Windows at all. See #1325.

Thatgfsj (Thatgfsj) pushed a commit to Thatgfsj-contribs/PowerShell that referenced this pull request Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants