Get-PSWorkItem

February 11, 2026 ยท View on GitHub

SYNOPSIS

Get a PSWorkItem.

SYNTAX

days (Default)

Get-PSWorkItem [-DaysDue <Int32>] [-Path <String>] [<CommonParameters>]

name

Get-PSWorkItem [[-Name] <String>] [-Path <String>] [<CommonParameters>]

id

Get-PSWorkItem [-ID <String>] [-Path <String>] [<CommonParameters>]

all

Get-PSWorkItem [-All] [-Path <String>] [<CommonParameters>]

Category

Get-PSWorkItem [-Path <String>] [-Category <String>] [<CommonParameters>]

DESCRIPTION

This command will retrieve PSWorkItems from the database using a parameter-defined query. The default behavior is to get all PSWorkItems due within the next 10 days. If you are running the command in the PowerShell console or VSCode, the default formatting will highlight overdue tasks in red and tasks due within 3 days in yellow.

EXAMPLES

Example 1

PS C:\> Get-PSWorkItem

   Database: C:\Users\Jeff\PSWorkItem.db

ID Name              Description         DueDate              Category Pct
-- ----              -----------         -------              -------- ---
 6 new server prep   SQL02               8/3/2025 5:00:00 PM  Work      45
 7 password report                       8/5/2025 12:00:00 PM Work      10
 5 revise blog pages essentials and tips 8/7/2025 5:00:00 PM  Other      0

Get all items due in the next 10 days.

Example 2

PS C:\> Get-PSWorkItem -all

   Database: C:\Users\Jeff\PSWorkItem.db

ID Name              Description         DueDate               Category Pct
-- ----              -----------         -------               -------- ---
 6 new server prep   SQL02               8/3/2025 5:00:00 PM   Work      45
 7 password report                       8/5/2025 12:00:00 PM  Work      10
 5 revise blog pages essentials and tips 8/7/2025 5:00:00 PM   Other      0
 1 update data                           8/28/2025 10:35:02 AM Temp       0
 9 Prep vacation                         11/1/2025 5:00:00 PM  Personal   0
 8 Year end backup                       12/31/2025 5:00:00 PM Work       0

Get all open tasks.

Example 3

PS C:\> Get-PSWorkItem -Category Work

   Database: C:\Users\Jeff\PSWorkItem.db

ID Name            Description DueDate               Category Pct
-- ----            ----------- -------               -------- ---
 6 new server prep SQL02       8/3/2025 5:00:00 PM   Work      45
 7 password report             8/5/2025 12:00:00 PM  Work      10
 8 Year end backup             12/31/2025 5:00:00 PM Work       0

Get tasks from the Work category.

Example 4

PS C:\> Get-PSWorkItem -id 9

   Database: C:\Users\Jeff\PSWorkItem.db

ID Name          Description DueDate              Category Pct
-- ----          ----------- -------              -------- ---
 9 Prep vacation             11/1/2025 5:00:00 PM Personal   0

Get a PSWorkItem by its ID.

Example 5

PS C:\> Get-PSWorkItem -Name p*

   Database: C:\Users\Jeff\PSWorkItem.db

ID Name            Description DueDate              Category Pct
-- ----            ----------- -------              -------- ---
 7 password report             8/5/2025 12:00:00 PM Work      10
 9 Prep vacation               11/1/2025 5:00:00 PM Personal   0

Get PSWorkItems with a name that begins with P.

Example 6

PS C:\> Get-PSWorkItem | Format-Table -View countdown

ID Name              Description         DueDate              TimeRemaining
-- ----              -----------         -------              -------------
6  new server prep   SQL02               8/3/2025 5:00:00 PM     4.05:20:31
7  password report                       8/5/2025 12:00:00 PM    6.00:20:31
5  revise blog pages essentials and tips 8/7/2025 5:00:00 PM     8.05:20:31

The PSWorkItem has a named table view called Countdown.

Example 7

PS C:\> Get-PSWorkItem | Where Overdue

   Database: C:\Users\Jeff\PSWorkItem.db

ID Name                Description DueDate               Category Pct
-- ----                ----------- -------               -------- ---
13 extend car warranty             6/1/2025 4:00:00 PM   Personal   0
11 update resume                   7/12/2025 12:00:00 PM Work       0
 7 password report                 7/15/2025 5:00:00 PM  Work      10

Get all overdue PSWorkItems.

Example 8

PS C:\> Get-PSWorkItem -all | Sort-Object category | Format-Table -view category

   Category: Other

ID    Name                 Description               DueDate                 Pct
--    ----                 -----------               -------                 ---
5     revise blog pages    essentials and tips       8/7/2025 5:00:00 PM       0

   Category: Personal

ID    Name                 Description               DueDate                 Pct
--    ----                 -----------               -------                 ---
13    extend car warranty                            6/1/2025 4:00:00 PM       0
10    car wash                                       8/2/2025 11:54:31 AM      0
9     Prep vacation                                  11/1/2025 5:00:00 PM      0

   Category: Project

ID    Name                 Description               DueDate                 Pct
--    ----                 -----------               -------                 ---
12    Publish PSWorkItem                             8/2/2025 12:05:44 PM      0
...

Get PSWorkItems sorted by category and display using the Category table view.

PARAMETERS

-All

Get all open PSWorkItems except for those in the Hidden category.

Type: SwitchParameter
Parameter Sets: all
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Category

Get all open PSWorkItems by category. There should be tab completion for this parameter. If you are specifying an alternate path, specify the path before using this parameter.

Beginning with module version 1.13.0 you can set the category to Hidden. This will have the effect of hiding the PSWorkItem from the default Get-PSWorkItem output unless you specify the Hidden category.

Type: String
Parameter Sets: Category
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-DaysDue

Get open PSWorkItems due in the number of days between 1 and 365.

Type: Int32
Parameter Sets: days
Aliases:

Required: False
Position: Named
Default value: 10
Accept pipeline input: False
Accept wildcard characters: False

-ID

The task ID.

Type: String
Parameter Sets: id
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

The name of the PSWorkItem. Wildcards are supported.

Type: String
Parameter Sets: name
Aliases: task

Required: False
Position: 0
Default value: None
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: True

-Path

The path to the PSWorkItem SQLite database file. It should end in .db.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: $PSWorkItemPath
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.String

OUTPUTS

PSWorkItem

NOTES

This command has an alias of gwi.

Learn more about PowerShell: http://jdhitsolutions.com/yourls/newsletter

Complete-PSWorkItem

Get-PSWorkItemArchive

Remove-PSWorkItem

New-PSWorkItem

Set-PSWorkItem

Open-PSWorkItemConsole