{"id":28485381,"url":"https://github.com/gioxx/nebula.log","last_synced_at":"2025-09-09T11:36:22.359Z","repository":{"id":295958710,"uuid":"991822659","full_name":"gioxx/Nebula.Log","owner":"gioxx","description":"A lightweight and configurable logging module for PowerShell scripts.","archived":false,"fork":false,"pushed_at":"2025-07-16T12:06:35.000Z","size":845,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-17T14:47:45.672Z","etag":null,"topics":["powershell","powershell-module"],"latest_commit_sha":null,"homepage":"https://go.gioxx.org/nebula-log","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gioxx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-28T07:45:47.000Z","updated_at":"2025-07-16T12:05:52.000Z","dependencies_parsed_at":"2025-06-28T06:32:31.963Z","dependency_job_id":"17f06c5e-68d6-4082-b3b0-45b345d7c490","html_url":"https://github.com/gioxx/Nebula.Log","commit_stats":null,"previous_names":["gioxx/nebula.log"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/gioxx/Nebula.Log","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gioxx%2FNebula.Log","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gioxx%2FNebula.Log/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gioxx%2FNebula.Log/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gioxx%2FNebula.Log/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gioxx","download_url":"https://codeload.github.com/gioxx/Nebula.Log/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gioxx%2FNebula.Log/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266135014,"owners_count":23881774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell","powershell-module"],"created_at":"2025-06-08T00:10:18.045Z","updated_at":"2025-09-09T11:36:22.336Z","avatar_url":"https://github.com/gioxx.png","language":"PowerShell","readme":"# Nebula.Log\n\n**Nebula.Log** is a lightweight and configurable logging module for PowerShell scripts.\n\n![PowerShell Gallery](https://img.shields.io/powershellgallery/v/Nebula.Log?label=PowerShell%20Gallery)\n![Downloads](https://img.shields.io/powershellgallery/dt/Nebula.Log?color=blue)\n\n---\n\n## ✨ Features\n\n- Logging with levels: `INFO`, `SUCCESS`, `WARNING`, `DEBUG`, `ERROR`\n- Output to both console and log file (you can also choose to output only on log file using `-WriteOnlyToFile` switch)\n- Auto-archives log file if it exceeds 512 KB\n- You can test the logging setup using `Test-ActivityLog` function ([read more](#-test-activitylog-in-detail))\n- Includes alias `Log-Message` (to call `Write-Log` function)\n\n---\n\n## 📦 Installation\n\nInstall from the [PowerShell Gallery](https://www.powershellgallery.com/packages/Nebula.Log):\n\n```powershell\nInstall-Module -Name Nebula.Log -Scope CurrentUser\n```\n\n---\n\n## 🚀 Usage\n\nBasic example (output to both console and log file):\n\n```powershell\nWrite-Log -LogLocation \"C:\\Logs\" -Message \"Starting script ...\" -Level \"INFO\" -WriteToFile\n```\n\nBasic example (output to log file only):\n\n```powershell\nWrite-Log -LogLocation \"C:\\Logs\" -Message \"Starting script ...\" -Level \"INFO\" -WriteToFile -WriteOnlyToFile\n```\n\nTesting the logging setup:\n\n```powershell\nTest-ActivityLog -LogLocation \"C:\\Logs\"\n```\n\n---\n\n### 🔍 `Test-ActivityLog` in detail\n\nThis function validates the availability and write capability of a specified activity log file.\n\n#### **Syntax**\n\n```powershell\nTest-ActivityLog -LogLocation \u003cString\u003e [-LogFileName \u003cString\u003e]\n```\n\n#### **Parameters**\n\n- `LogLocation` (String, **Required**)  \n  The directory where the log file is expected to be located.\n\n- `LogFileName` (String, Optional)  \n  The name of the log file. Defaults to `activity.log` if not specified.\n\n- `TryFix` (Switch, Optional)  \n  If the `activity.log` file is not writable, the function tries to rename the old file and create a new one where new log messages can be written.\n\n#### **Description**\n\n`Test-ActivityLog` checks whether the specified log file exists and is writable by the current user. If the file doesn't exist or is not writable, it returns `\"KO\"` and writes an error. If everything is in order, it appends a test entry and returns `\"OK\"`. You can also use `TryFix` switch in case the file is not writable, to attempt an automatic _repair_.\n\nThis is useful for automated checks or pre-flight validations before starting logging operations.\n\n#### **Example**\n\n```powershell\nTest-ActivityLog -LogLocation \"C:\\Logs\"\n```\n\nReturns `\"OK\"` if `C:\\Logs\\activity.log` exists and is writable, otherwise `\"KO\"`.\n\n```powershell\nTest-ActivityLog -LogLocation \"C:\\Logs\" -TryFix\n```\n\nTry renaming the old, damaged, non-writable file so that you can create a new one in which to keep track of new log messages.\n\n---\n\n## 🧪 Testing with Pester\n\n```powershell\nInvoke-Pester -Script .\\Nebula.Log.Tests.ps1\n```\n\n---\n\n## 🧽 How to clean up old module versions (optional)\n\nWhen updating from previous versions, old files (such as unused `.psm1`, `.yml`, or `LICENSE` files) are not automatically deleted.  \nIf you want a completely clean setup, you can remove all previous versions manually:\n\n```powershell\n# Remove all installed versions of the module\nUninstall-Module -Name Nebula.Log -AllVersions -Force\n\n# Reinstall the latest clean version\nInstall-Module -Name Nebula.Log -Scope CurrentUser -Force\n```\n\nℹ️ This is entirely optional — PowerShell always uses the most recent version installed.\n\n---\n\n## 📄 License\n\nAll scripts in this repository are licensed under the [MIT License](https://opensource.org/licenses/MIT).\n\n---\n\n## 🔧 Development\n\nThis module is part of the [Nebula](https://github.com/gioxx?tab=repositories\u0026q=Nebula) PowerShell tools family.\n\nFeel free to fork, improve and submit pull requests.\n\n---\n\n## 📬 Feedback and Contributions\n\nFeedback, suggestions, and pull requests are welcome!  \nFeel free to [open an issue](https://github.com/gioxx/Nebula.Log/issues) or contribute directly.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgioxx%2Fnebula.log","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgioxx%2Fnebula.log","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgioxx%2Fnebula.log/lists"}