PowerShell.tiPS icon indicating copy to clipboard operation
PowerShell.tiPS copied to clipboard

Add -Previous switch to retrieve last shown tip

Open Copilot opened this issue 4 months ago • 0 comments

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)

  • Fixes deadlydog/PowerShell.tiPS#147

✨ 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 avatar Oct 24 '25 23:10 Copilot