Skip to content
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

The refreshenv command throws an error about Write-FunctionCallLogMessage when ran in PowerShell on 0.10.2. #996

Closed
jesseconnr opened this issue Oct 3, 2016 · 1 comment

Comments

@jesseconnr
Copy link

What You Are Seeing?

In release 0.10.2 when running refreshenv from powershell, several errors are output.

What is Expected?

The expected result would be that no errors are output.

How Did You Get This To Happen? (Steps to Reproduce)

Upgrade to chocolatey 0.10.2 and run refreshenv from powershell.

The Reason

The chocolateyProfile.psm1 uses the function Get-EnvironmentVariable. This function in turn uses Write-FunctionCallLogMessage, but Write-FunctionCallLogMessage.psm1 is not imported in the profile and therefore errors occur.

chocolateyProfile.psm1#L20

Get-EnvironmentVariable.ps1#L65

Write-FunctionCallLogMessage.ps1

Output Log

There is no log generated with the refreshenv command, but here is the console output.

Chocolatey Veriosn: 0.10.2
OS: Windows 10 Enterprise x64
PS Version: 5.1.14393.206

https://gist.github.com/jesseconnr/37e5d78d008fd5bb9fa8b9dbb6e5f08c

@ferventcoder ferventcoder added this to the 0.10.3 milestone Oct 3, 2016
@ferventcoder ferventcoder self-assigned this Oct 3, 2016
ferventcoder added a commit that referenced this issue Oct 3, 2016
With the new call to Write-FunctionCallLogMessage.ps1, the profile was
not updated to use that call. So it fails with lots of red text on the
screen as you attempt to run things like `refreshenv` from PowerShell.
Add the function to be loaded so there are no issues running
`refreshenv`.
ferventcoder added a commit to ferventcoder/choco that referenced this issue Oct 3, 2016
* stable:
  (maint) update RefreshEnv messaging
  (chocolateyGH-996) Fix: RefreshEnv command throws errors
@ferventcoder
Copy link
Member

Fixed for 0.10.3. Thanks for reporting!

ferventcoder added a commit that referenced this issue Oct 5, 2016
Before running the before modify script, the provider should ensure
that the user has not configured to skip the package install provider
scripts.
ferventcoder added a commit that referenced this issue Oct 5, 2016
Be able to pass the before modify action to the ISourceRunner service
so it can choose the best time to make the call to the before modify
action (typically before anything other work is completed).
ferventcoder added a commit to ferventcoder/choco that referenced this issue Oct 5, 2016
* stable:
  (chocolateyGH-1000) Allow `$LASTEXITCODE` check by feature
  (chocolateyGH-1000) Don't check $LASTEXITCODE by default
  (chocolateyGH-995) Ensure beforeModify runs as first action
  (maint) specs fixup
  (chocolateyGH-996) ISourceRunner.uninstall beforeModify action
  (chocolateyGH-996) beforemodify check before run
  (chocolateyGH-995) rename before_package_upgrade
@ferventcoder ferventcoder changed the title The refreshenv command throws an error about Write-FunctionCallLogMessage when ran in powershell on 0.10.2. The refreshenv command throws an error about Write-FunctionCallLogMessage when ran in PowerShell on 0.10.2. Oct 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants