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

Debug/Verbose messages not logged in automation scripts #520

Closed
ferventcoder opened this issue Dec 28, 2015 · 0 comments
Closed

Debug/Verbose messages not logged in automation scripts #520

ferventcoder opened this issue Dec 28, 2015 · 0 comments
Assignees
Milestone

Comments

@ferventcoder
Copy link
Member

Write-Debug / Write-Verbose messages are not being logged when coming from the chocolateyInstall/chocolateyUninstall scripts. This is due to DebugPreference and VerbosePreference being only set to script level in the module and not global.

@ferventcoder ferventcoder added this to the 0.9.10 milestone Dec 28, 2015
@ferventcoder ferventcoder self-assigned this Dec 28, 2015
ferventcoder added a commit to ferventcoder/choco that referenced this issue Dec 28, 2015
`Write-Debug` / `Write-Verbose` messages are not being logged when
coming from the `chocolateyInstall`/`chocolateyUninstall` scripts. This
is due to `DebugPreference` / `VerbosePreference` being only set to
script level in the module and not global.

Instead of changing a global variable, also set the Debug and Verbose
preferences in the script runner. It is thought that changing a global
variable could have other unintended consequences if someone was
running these scripts directly from PowerShell. So prefer the script
level change.
ferventcoder added a commit that referenced this issue Jan 1, 2016
* stable:
  (doc) update Changelog
  (GH-8) Use Custom PowerShell Host
  (GH-8) Configuration for PowerShell Host
  (GH-8) Implement Custom PowerShell Host
  (GH-8) Add System.Management.Automation binary
  (GH-8) Convert to SecureString
  (GH-8) ReadKey Timeout
  (GH-8) Run commands with timeout
  (maint) add messages to package installers
  (GH-8) ReadLine Timeout
  (GH-445) Scenario docs update
  (GH-520) Fix: Debug/Verbose messages not logged
@ferventcoder ferventcoder changed the title Debug/Verbose messages not logged in install scripts Debug/Verbose messages not logged in automation scripts Jan 29, 2016
ferventcoder added a commit that referenced this issue Feb 11, 2016
There are instances where the settings were not being applied, such as
logging in script blocks. Ensure the preferences are set globally.
ferventcoder added a commit that referenced this issue Feb 11, 2016
* pr617:
  (maint) comment cleanup
  (GH-526) set messaging to output as error
  (GH-520) Debug/Verbose should be global scope
  (maint) formatting
  (GH-616) Deterministicly capture unzipped/extracted files
ferventcoder added a commit that referenced this issue Feb 11, 2016
* stable:
  (maint) comment cleanup
  (GH-526) set messaging to output as error
  (GH-520) Debug/Verbose should be global scope
  (maint) formatting
  (GH-616) Deterministicly capture unzipped/extracted files
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

2 participants