8000 GitHub - JPRuskin/ChocolateyLogs: A PowerShell module for parsing and filtering Chocolatey product logs. · GitHub
[go: up one dir, main page]

Skip to content

About

A PowerShell module for parsing and filtering Chocolatey product logs.

Resources

Code of conduct

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

13 Commits

Folders and files

Repository files navigation

Flake (a module for viewing Chocolatey logs)

Installation

Download the files from this repository and put them in a folder on your machine.

You should then be able to run Import-Module .\path\to\Flake.psd1.

Alternatively, install it from the PowerShell Gallery.

Usage

Get-ChocolateyCall

Get-ChocolateyCall [[-Path] <string[]>] [[-Last] <ushort>] [<CommonParameters>]

image

This should produce a list of commands that you have run, along with their start time and exit code. E represents a command that threw an exception, was killed mid-task, or is otherwise incomplete.

You can see all configuration at the time of a given command by using the GetConfiguration() method.

You can access the full log for a given call by expanding Output.

Get-ChocolateyLog

Get-ChocolateyLog [[-Path] <string[]>] [<CommonParameters>]

This somewhat colourised, trimmed down, output can also be displayed by using Get-ChocolateyLog. This will output everything in your log in a slightly formatted way. The main differences are that multi-line logs only show up as one line (so you don't see all of the settings unless you dig into them), and it only displays a formatted timestamp and a colourised message by default.

image

Debug is in purple, errors are in red, warnings are in yellow, and info (stdout) is in white. NuGet and Verbose lines are coloured in gray, because they are infrequently helpful but take up a lot of space. You can filter against the stream property as follows:

Get-ChocolateyLog | Where Stream -eq 'Error'

Show-ChocolateyLogTail

Show-ChocolateyLogTail [[-Path] <string>] [[-Last] <ushort>] [<CommonParameters>]

This function simply tails the specified log and streams formatted ChocolateyLog objects until cancelled with Ctrl+C.

If -Last is specified, it starts by showing the last X log entries.

Contribution

Building the Module

Checkout or download the repository as you'd prefer. You'll need to ensure you have the required modules, including:

  • ModuleBuilder

For testing the module, you will also require:

  • Pester (v5+)
  • PSScriptAnalyzer

To automatically install these requirements, you can run Requirements.ps1.

You can then build the module by running Build.ps1.

Testing the Module

About

A PowerShell module for parsing and filtering Chocolatey product logs.

Resources

Code of conduct

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages

0