Skip to content

TirsvadScript/PS.Logging

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

downloads Contributors Forks Stargazers Issues License LinkedIn

Logo Logging

PowerShell Logging Module

Overview

PS.Logging is a PowerShell module designed to facilitate logging in PowerShell scripts and modules. It provides a simple and flexible way to log messages with different severity levels, making it easier to track and debug script execution.

Features

  • Supports multiple log levels (e.g., Info, Warning, Error)
  • Easy integration with existing PowerShell scripts
  • Lightweight and fast

Quick Start

Download and Install

To install the PS.Logging module, you can use the following PowerShell command:

Install-Module -Name PS.Logging -Scope CurrentUser

Import the Module

After installation, import the module into your PowerShell session:

Import-Module PS.Logging

Basic Usage

You can start logging messages using the Write-Log cmdlet. Here are some examples:

Write-Header -Message "How to use Logging Examples"
# Log an informational message
Write-Info -Message "This is an informational message."
# Log a warning message
Write-Warn -Message "This is a warning message."
# Log an error message
Write-Err -Message "This is an error message."

Git Repository

You can clone the repository using the following command:

git clone https://github.com/TirsvadScript/PS.Logging.git

Testing

The module includes a suite of Pester tests to ensure functionality and reliability. To run the tests, use the following command:

try { powershell -NoProfile -NoLogo -Command "Import-Module Pester -ErrorAction SilentlyContinue; Invoke-Pester -Script .\logging.Tests.ps1 -OutputFormat NUnitXml -OutputFile test-results.xml" } finally { if ($?) { echo "bbb6c4dc03844c2986fd1ddfd0ceb545=$?" } else { echo "bbb6c4dc03844c2986fd1ddfd0ceb545=$?" } }

Contributing

Contributions are welcome. Please follow the guidelines in CONTRIBUTING.md and open issues or pull requests.

See CONTRIBUTING.md

Reporting Bugs

  1. Go to the Issues page: GitHub Issues
  2. Click "New Issue" and provide steps to reproduce, expected behavior, actual behavior, environment, and attachments (logs/screenshots).

License

Distributed under the AGPL-3.0 License. See LICENSE.txt or license link.

Contact

Jens Tirsvad Nielsen - LinkedIn

Acknowledgments

Thanks to contributors and the open-source community.

About

No description, website, or topics provided.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published