jdhitsolutions / PSWorkItem

A PowerShell 7 module for managing work and personal tasks or to-do items. This module uses a SQLite database to store task and category information. The module is not a full-featured project management solution, but should be fine for personal needs. The module requires a 64-bit Windows or Linux platform.
MIT License
36 stars 5 forks source link

[Bug]: New-PSWorkItem failure with -PassThru #5

Closed jbelina closed 1 year ago

jbelina commented 1 year ago

Describe the problem

When creating a new task using the -PassThru feature, the path is not passed into _newWorkItem resulting in the following error calling Convert-Path.

PS> New-PSWorkItem -Category work -Name "still testing" -Passthru -Debug -Verbose | Format-List

Error Message: DEBUG: [23:02:02.9422279 _newWorkItem] Creating item 'still testing' [0f3664f3-be5a-4609-94fa-268d96928d1a] Convert-Path: C:...\PowerShell\Modules\PSWorkItem\0.8.0\functions\private\helpers.ps1:18 Line | 18 | $item.path = Convert-Path $path | ~ | Cannot bind argument to parameter 'Path' because it is an empty string.

Expectation

The new task should be passed through to the pipeline without error.

Additional Information

This issue is new to v0.8.0 due to the change in _newWorkItem and affects both New-PSWorkItem and Complete-PSWorkItem

(I have a fix ready and tested.)

PowerShell version

7.2

Platform

Windows 11 Home

Additional Checks

jdhitsolutions commented 1 year ago

I get the same error.

jdhitsolutions commented 1 year ago

PR merged. This will be added in v0.9.0.