Functions/GenXdev.Coding/Get-Todoos.ps1
|
<############################################################################## Part of PowerShell module : GenXdev.Coding Original cmdlet filename : Get-Todoos.ps1 Original author : René Vaessen / GenXdev Version : 3.28.2026 ################################################################################ Copyright (c) 2026 René Vaessen / GenXdev Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ################################################################################> ############################################################################### <# .SYNOPSIS Displays todo items from a README.md file. .DESCRIPTION Shows all todo items from the "## Todoos" section of a README.md file. Can use either the README in the current location, PowerShell profile directory, or OneDrive directory. .PARAMETER UseHomeREADME Use README.md from PowerShell profile directory instead of current location. .PARAMETER UseOneDriveREADME Use README.md from OneDrive directory instead of current location. .PARAMETER SortByDate Sort lines by date (yyyyMMdd prefix) instead of priority. .PARAMETER Ascending Reverse the sort order. By default, higher priority/newer dates appear first. .PARAMETER First Limit the output to the first N lines. .EXAMPLE Todoos -UseHomeREADME .EXAMPLE Todoos -UseOneDriveREADME #> function Get-Todoos { [CmdletBinding()] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseSingularNouns', '')] [System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseBOMForUnicodeEncodedFile', '')] [Alias('todoos')] param( ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Use README in PowerShell profile directory' )] [switch] $UseHomeREADME, ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Use README in OneDrive directory' )] [switch] $UseOneDriveREADME, ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Sort lines by date (yyyyMMdd prefix) instead of priority' )] [switch] $SortByDate, ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Reverse the sort order (ascending instead of descending)' )] [switch] $Ascending, ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Limit output to the first N lines' )] [int] $First = 0, ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Show only completed (☒) items' )] [switch] $OnlyCompleted, ####################################################################### [Parameter( Mandatory = $false, HelpMessage = 'Exclude completed (☒) items, showing only incomplete' )] [switch] $ExcludeCompleted ####################################################################### ) begin { Microsoft.PowerShell.Utility\Write-Verbose 'Starting Todoos function' } process { # display todos using base function GenXdev\Add-TodoLineToREADME ` -Show ` -SortByDate:$SortByDate ` -Ascending:$Ascending ` -OnlyCompleted:$OnlyCompleted ` -ExcludeCompleted:$ExcludeCompleted ` -First $First ` -UseHomeREADME:$UseHomeREADME ` -UseOneDriveREADME:$UseOneDriveREADME } end { } } |