Skip to content
This repository has been archived by the owner on Feb 19, 2019. It is now read-only.

[Bug] Posh v3+ ignores -Wait when run from cmd.exe #516

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/helpers/functions/Get-ChocolateyUnzip.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ param(
$unzipOps = {
param($7zip, $destination, $fileFullPath, [ref]$exitCodeRef)
$p = Start-Process $7zip -ArgumentList "x -o`"$destination`" -y `"$fileFullPath`"" -Wait -WindowStyle Hidden -PassThru
Wait-Process -InputObject $p
Copy link
Contributor

Choose a reason for hiding this comment

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

It's weird that this would be required when start process above has -Wait already on it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's weird that this would be required when start process above has -Wait already on it.

Yep, that's puzzling. Probably a bug on the powershell side?

As a side note, it worked for me when I ran the cocolatey command from inside powershell, but not inside a cmd window.

I can reproduce the recipe mentioned here.

$exitCodeRef.Value = $p.ExitCode
}

Expand Down