-
Notifications
You must be signed in to change notification settings - Fork 99
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(GH-61) Fix choco install package result #103
base: development
Are you sure you want to change the base?
(GH-61) Fix choco install package result #103
Conversation
new pullrequest originally pullrequest 102. |
@@ -1,4 +1,4 @@ | |||
# Copyright (c) 2017 Chocolatey Software, Inc. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you remove this change from the commit?
@@ -240,13 +240,9 @@ function InstallPackage | |||
$chocoinstallparams += " $cParams" | |||
} | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason this has been removed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the purge command can cause errors and hangs code in DSC configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
he purge command can cause errors and hangs code in DSC configurations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added the purge command again.
@@ -389,41 +383,81 @@ Function Upgrade-Package { | |||
if ($cParams) { | |||
$chocoupgradeparams += " $cParams" | |||
} | |||
$cmd = "choco upgrade $pName $chocoupgradeparams" | |||
$cmd = "upgrade $pName $chocoupgradeparams" | |||
Write-Verbose -Message "Upgrade command: '$cmd'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see this change in the latest commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the choco
# Clear Package Cache | ||
Get-ChocoInstalledPackage 'Purge' | ||
function Get-ChocoInstalledPackage { | ||
Return (choco list -lo -r | ConvertFrom-Csv -Header 'Name', 'Version' -Delimiter "|") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment around this.
#Set $LASTEXITCODE variable. | ||
powershell.exe -NoLogo -NoProfile -Noninteractive "exit $exitcode" | ||
|
||
if($exitcode -in $validExitCodes ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its ignore/ non error
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>:
… @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? |
@@ -325,7 +324,7 @@ Function Test-LatestVersionInstalled { | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 <[email protected]>:
… @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 <[email protected]>:
… 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