🩹 [Patch]: Tweaks on outputs and fix for Get-ContextInfo#91
Merged
Conversation
Get-ContextInfo
Contributor
There was a problem hiding this comment.
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. |
…ngle and array IDs in VaultA
…f "Start" across multiple context functions
…g in Get-ContextInfo, Remove-Context, and Set-Context functions
|
Module Context - 8.0.1 published to the PowerShell Gallery. |
|
GitHub release for Context v8.0.1 has been created. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
Get-ContextInfo.ps1to iterate through multiple IDs ($ID) using aforeachloop, ensuring compatibility with multiple inputs.Remove-Context.ps1to useWrite-Debuginstead ofWrite-Outputfor removed item messages, aligning with debugging practices.Set-Context.ps1to improve debugging output by processingFormat-Listresults as a stream for better readability in logs.Error Message Improvements:
Rename-Context.ps1by removing conditional text, making them more straightforward and easier to read.Output Type Update:
Rename-Context.ps1from[System.String]to[object]for broader compatibility and added an explicit[OutputType([object])]declaration.Type of change
Checklist