(GH-61) Fix choco install package result#103
(GH-61) Fix choco install package result#103esiebes wants to merge 25 commits intochocolatey:developmentfrom
Conversation
|
new pullrequest originally pullrequest 102. |
| @@ -1,4 +1,4 @@ | |||
| # Copyright (c) 2017 Chocolatey Software, Inc. | |||
There was a problem hiding this comment.
Can you remove this change from the commit?
| Write-Verbose -Message "Install command: 'choco install $pName $chocoinstallparams'" | ||
|
|
||
| $packageInstallOuput = Invoke-Expression -Command "choco install $pName $chocoinstallparams" | ||
| $packageInstallOuput = Invoke-ChocoLatey "install $pName $chocoinstallparams" |
There was a problem hiding this comment.
Picky but can you change Invoke-ChocoLatey to a lowercase 'l'?
Can you also add the arguments parameter explicitly?
| Write-Verbose -Message "Package output $packageInstallOuput " | ||
|
|
||
| # Clear Package Cache | ||
| Get-ChocoInstalledPackage 'Purge' |
There was a problem hiding this comment.
Is there a reason this has been removed?
There was a problem hiding this comment.
the purge command can cause errors and hangs code in DSC configurations.
There was a problem hiding this comment.
There are no issues submitted around the purge command. If this isn't the fix for the issue itself can you raise an issue we can look at and remove it from this PR?
| Write-Verbose -Message "Package uninstall output $packageUninstallOuput " | ||
|
|
||
| # Clear Package Cache | ||
| Get-ChocoInstalledPackage 'Purge' |
There was a problem hiding this comment.
he purge command can cause errors and hangs code in DSC configurations.
There was a problem hiding this comment.
I added the purge command again.
| } | ||
| $cmd = "choco upgrade $pName $chocoupgradeparams" | ||
| $cmd = "upgrade $pName $chocoupgradeparams" | ||
| Write-Verbose -Message "Upgrade command: '$cmd'" |
There was a problem hiding this comment.
I'd like to keep that Verbose message consistent from what it was previously - prepend it with 'choco'?
There was a problem hiding this comment.
I don't see this change in the latest commit.
| Get-ChocoInstalledPackage 'Purge' | ||
| function Get-ChocoInstalledPackage { | ||
| Return (choco list -lo -r | ConvertFrom-Csv -Header 'Name', 'Version' -Delimiter "|") | ||
| } |
There was a problem hiding this comment.
What's your thinking behind running this every time rather than caching it for 60 seconds?
The Return isn't needed.
There was a problem hiding this comment.
In some instances of DSC configuratioin 60 seconds is to long if a small package is installed, so the test will fail I will remove the Return
| #Set $LASTEXITCODE variable. | ||
| powershell.exe -NoLogo -NoProfile -Noninteractive "exit $exitcode" | ||
|
|
||
| if($exitcode -in $validExitCodes ) |
There was a problem hiding this comment.
What happens if a non-MSI exits with one of the MSI exit codes? That could indicate an error but it's ignored?
There was a problem hiding this comment.
If an EXE exits with an error code that matches one of those we need that to come through. Ignoring it would indicate it installed it okay when in fact it didn't.
|
@esiebes Is this still a PR you are wanting to work on? |
|
yes, i will work on it asap
Op zo 28 jul. 2019 16:42 schreef Paul Broadwith <notifications@github.com>:
… @esiebes <https://github.com/esiebes> Is this still a PR you are wanting
to work on?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103?email_source=notifications&email_token=AIEO72WOUTKY5QGHITNINVDQBWV4DA5CNFSM4EIE6TEKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD27AA2I#issuecomment-515768425>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIEO72WVMNTQ2JGIIONXJM3QBWV4DANCNFSM4EIE6TEA>
.
|
|
@esiebes Are you still working on this? |
| Write-Verbose -Message "Testing if $pName can be upgraded: 'choco upgrade $pName $chocoupgradeparams'" | ||
|
|
||
| $packageUpgradeOuput = Invoke-Chocolatey "upgrade $pName $chocoupgradeparams" | ||
| $packageUpgradeOuput = Invoke-Chocolatey "choco upgrade $pName $chocoupgradeparams" |
There was a problem hiding this comment.
The choco command shouldn't be passed to Invoke-Chocolatey.
|
@esiebes Are you still wanting to take this forward? |
|
Yes, will forward the changes tomorrow.
Op do 21 mei 2020 18:01 schreef Paul Broadwith <notifications@github.com>:
… @esiebes <https://github.com/esiebes> Are you still wanting to take this
forward?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIEO72RTB2W56QDGKCM4DGTRSVF45ANCNFSM4EIE6TEA>
.
|
|
I keep getting a failed test in appveyor on the psscriptanalyzer test. Local on my machine i dont get it. Someon an idea? |
|
Are you running the same version of PSScriptAnalzyer? Can I also ask you to update some of those commit messages and preferably squash some of them? |
|
I will do that. Whih versiin is used?
Op di 23 jun. 2020 13:28 schreef Paul Broadwith <notifications@github.com>:
… Are you running the same version of PSScriptAnalzyer?
Can I also ask you to update some of those commit messages and preferably
squash some of them?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#103 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AIEO72VIAGJFDTYI35357TLRYCGWBANCNFSM4EIE6TEA>
.
|
choco exitcode typo missed some bracket add missing function else block added, gone after merge should process with test not used add shouldprocess to Invoke chocolatey add verbose to scriptstest shouldprocess thing error no error local found with shouldprocess mm
…es/cChoco into feature/chocoinstallresult
Changes cChocoPackagesInstall to validate choco's exit code. Handles the standard exit codes as documented in Chocolatey's documentation. Fixes issue chocolatey#61 Supersedes chocolatey#103
edit comments from pullrequest 102
Supersedes #102
Related to #61