Skip to content

🩹 [Patch]: Tweaks on outputs and fix for Get-ContextInfo#91

Merged
Marius Storhaug (MariusStorhaug) merged 6 commits into
mainfrom
tweaks
Jun 8, 2025
Merged

🩹 [Patch]: Tweaks on outputs and fix for Get-ContextInfo#91
Marius Storhaug (MariusStorhaug) merged 6 commits into
mainfrom
tweaks

Conversation

@MariusStorhaug

@MariusStorhaug Marius Storhaug (MariusStorhaug) commented Jun 8, 2025

Copy link
Copy Markdown
Member

Description

This pull request introduces several updates to improve code clarity, debugging output, and functionality across multiple PowerShell scripts. Key changes include enhancing debug information, refining error messages, and updating output types for better compatibility.

Debugging and Logging Enhancements:

  • Updated Get-ContextInfo.ps1 to iterate through multiple IDs ($ID) using a foreach loop, ensuring compatibility with multiple inputs.
  • Changed Remove-Context.ps1 to use Write-Debug instead of Write-Output for removed item messages, aligning with debugging practices.
  • Modified Set-Context.ps1 to improve debugging output by processing Format-List results as a stream for better readability in logs.

Error Message Improvements:

  • Simplified error messages in Rename-Context.ps1 by removing conditional text, making them more straightforward and easier to read.

Output Type Update:

  • Updated the output type in Rename-Context.ps1 from [System.String] to [object] for broader compatibility and added an explicit [OutputType([object])] declaration.

Type of change

  • 📖 [Docs]
  • 🪲 [Fix]
  • 🩹 [Patch]
  • ⚠️ [Security fix]
  • 🚀 [Feature]
  • 🌟 [Breaking change]

Checklist

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas

Copilot AI review requested due to automatic review settings June 8, 2025 11:20
@MariusStorhaug Marius Storhaug (MariusStorhaug) changed the title 🩹 [Patch]: Tweaks on outputs and fix for Get-ContextInfo 🩹 [Patch]: Tweaks on outputs and fix for Get-ContextInfo Jun 8, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses several improvements across PowerShell scripts by enhancing debugging output, standardizing error messages, and updating output types for better compatibility.

  • Improved debug logging in Set-Context.ps1 and Get-ContextInfo.ps1.
  • Simplified error messages and updated output type declarations in Rename-Context.ps1.
  • Aligned removal messaging with debugging practices in Remove-Context.ps1.

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
src/functions/public/Set-Context.ps1 Updated debug logging to stream Format-List output via Write-Debug.
src/functions/public/Rename-Context.ps1 Changed output type from [System.String] to object and adjusted error messages.
src/functions/public/Remove-Context.ps1 Switched from Write-Output to Write-Debug for removal messages.
src/functions/public/Get-ContextInfo.ps1 Introduced a loop to support multiple ID inputs, refining context matching.

Comment thread src/functions/public/Get-ContextInfo.ps1
@MariusStorhaug Marius Storhaug (MariusStorhaug) merged commit 818b0e8 into main Jun 8, 2025
37 checks passed
@github-actions

github-actions Bot commented Jun 8, 2025

Copy link
Copy Markdown

Module Context - 8.0.1 published to the PowerShell Gallery.

@github-actions

github-actions Bot commented Jun 8, 2025

Copy link
Copy Markdown

GitHub release for Context v8.0.1 has been created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants