Skip to content

Latest commit

 

History

History
229 lines (159 loc) · 4.89 KB

New-PSWorkItem.md

File metadata and controls

229 lines (159 loc) · 4.89 KB
external help file Module Name online version schema
PSWorkItem-help.xml
PSWorkItem
2.0.0

New-PSWorkItem

SYNOPSIS

Create a new PSWorkItem.

SYNTAX

date (Default)

New-PSWorkItem [-Name] <String> [[-Description] <String>] [-DueDate <DateTime>] [-Path <String>] [-PassThru] [-WhatIf] [-Confirm] [[-Category] <String>] [<CommonParameters>]

days

New-PSWorkItem [-Name] <String> [[-Description] <String>] [-DaysDue <Int32>] [-Path <String>] [-PassThru] [-WhatIf] [-Confirm] [[-Category] <String>] [<CommonParameters>]

DESCRIPTION

Use this command to add a new PSWorkItem to the database. It is assumed you have already defined your task categories. The default is to create a new PSWorkItem with a due date 30 days from now. You can specify any due date or the number of days from now.

EXAMPLES

Example 1

PS C:\> New-PSWorkItem -Name "Blog updates" -Description "update pages" -DueDate "8/15/2023 5:00PM" -Category Blog -PassThru

Create a new PSWorkItem with a due date 30 days from now. You should be able to use tab completion for the Category parameter.

Example 2

PS C:\> New-PSWorkItem -Name "Publish PSWorkItem" -DaysDue 3 -Category Project

Create a new PSWorkItem due in 3 days.

PARAMETERS

-Category

Select a valid category. The category must be pre-defined. There should be tab completion for this parameter. If you will be specifying an alternate database path, specify the path before using this parameter so that correct categories will be detected.

If you would like to set a default category you can manually add an entry to $PSDefaultParameterValues. Or use Update-PSWorkItemPreference with a default category and re-import the module into your PowerShell session.

Type: String
Parameter Sets: (All)
Aliases:

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

-Confirm

Prompts you for confirmation before running the command.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

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

-Description

Add a comment or task description. Do not include apostrophes.

Type: String
Parameter Sets: (All)
Aliases: comment

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

-DueDate

When is this task due? The default is the value of adding the number of days in $PSWorkItemDefaultDays to the current date. The module default is 30 days.

Type: DateTime
Parameter Sets: date
Aliases: Date

Required: False
Position: Named
Default value: $PSWorkItemDefaultDays from now
Accept pipeline input: True (ByPropertyName)
Accept wildcard characters: False

-Name

The name of the work item. Do not include apostrophes.

Type: String
Parameter Sets: (All)
Aliases: task

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

-PassThru

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-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

-WhatIf

Shows what would happen if the command runs. The command is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

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

-DaysDue

Specify the number of days before the task is due to be completed. Enter a value between 1 and 365.

Type: Int32
Parameter Sets: days
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: True (ByPropertyName)
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

None

PSWorkItem

NOTES

This command has an alias of nwi.

Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/

RELATED LINKS

Get-PSWorkItem

Set-PSWorkItem

Complete-PSWorkItem

Remove-PSWorkItem

Open-PSWorkItemConsole