Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 24, 2025

Feature: Add -Previous switch to Write-PowerShellTip cmdlet

Summary:
Implemented the feature request to add a -Previous switch to Write-PowerShellTip and Get-PowerShellTip cmdlets that allows users to display the last shown tip instead of showing a new tip. The tip is not marked as shown again when using this parameter.

Changes:

  • Added GetLastShownTipId helper function to retrieve the last shown tip ID
  • Added -Previous parameter to Get-PowerShellTip cmdlet
  • Added -Previous parameter to Write-PowerShellTip cmdlet
  • Added comprehensive tests (8 new test cases)
  • All 111 tests passing
  • Linter (PSScriptAnalyzer) passing

Notes:

  • Reverted unrelated PowerShellTips.json changes (line endings were normalized by build script)
  • Code review feedback addressed: removed redundant Mandatory = $false from switch parameters
Original prompt

This section details on the original issue you should resolve

<issue_title>Feature Request: Add "Write-PowerShellTip -Previous" switch to output the last shown tip</issue_title>
<issue_description>The PowerShell tips shown are already stored in a file in the module configuration. It would be great if we could use a -Previous switch on the Write-PowerShellTip cmdlet to show the last tip that was shown, instead of showing the next tip. We would want to make sure that when we show the "previous" tip, that it does not write the same tip ID to "tips shown" file again.</issue_description>

<agent_instructions>Follow the same coding conventions used in the other code files</agent_instructions>

Comments on the Issue (you are @copilot in this section)


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Add Write-PowerShellTip -Previous switch to show last tip Add -Previous switch to retrieve last shown tip Oct 25, 2025
Copilot AI requested a review from deadlydog October 25, 2025 00:02
Copilot finished work on behalf of deadlydog October 25, 2025 00:02
@@ -26,7 +26,7 @@
{
Copy link
Owner

Choose a reason for hiding this comment

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

Revert all changes to this file

Copy link
Owner

Choose a reason for hiding this comment

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

@copilot please make this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted all changes to PowerShellTips.json in commit b09d7bc.

Copilot AI requested a review from deadlydog October 27, 2025 23:29
Copilot finished work on behalf of deadlydog October 27, 2025 23:29
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.

Feature Request: Add "Write-PowerShellTip -Previous" switch to output the last shown tip

2 participants