Skip to content

Commit

Permalink
v1.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Jan 4, 2024
1 parent 5e2471f commit 549b324
Show file tree
Hide file tree
Showing 31 changed files with 637 additions and 362 deletions.
2 changes: 1 addition & 1 deletion License.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2023 JDH Information Technology Solutions, Inc.
Copyright (c) 2022-2024 JDH Information Technology Solutions, Inc.


Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
4 changes: 2 additions & 2 deletions PSWorkItem.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

@{
RootModule = 'PSWorkItem.psm1'
ModuleVersion = '1.5.0'
ModuleVersion = '1.6.0'
CompatiblePSEditions = 'Core'
GUID = '4d3ff215-69ea-4fe6-8ad6-97ffc3a15bfb'
Author = 'Jeff Hicks'
CompanyName = 'JDH Information Technology Solutions, Inc.'
Copyright = '(c) JDH Information Technology Solutions, Inc. All rights reserved.'
Description = '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 platform.'
Description = '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. You can manage work items from the command prompt with a series of PowerShell commands, or use a TUI-based management console. The module is not a full-featured project management solution, but should be fine for personal needs. The module requires a 64-bit Windows platform.'
PowerShellVersion = '7.3'
DotNetFrameworkVersion = '4.6'
ProcessorArchitecture = 'Amd64'
Expand Down
10 changes: 7 additions & 3 deletions PSWorkItem.psm1
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@

# used for culture debugging
# write-host "Importing with culture $(Get-Culture)"

if ((Get-Culture).Name -match "\w+") {
#write-host "Using culture $(Get-Culture)" -ForegroundColor yellow
Import-LocalizedData -BindingVariable strings
}
else {
#force using En-US if no culture found, which might happen on non-Windows systems.
Import-LocalizedData -BindingVariable strings -FileName PSWorkItem.psd1 -BaseDirectory .\en-us
#write-host "Loading $PSScriptRoot/en-us/PSWorkItem.psd1" -ForegroundColor yellow
Import-LocalizedData -BindingVariable strings -FileName PSWorkItem.psd1 -BaseDirectory $PSScriptRoot/en-us
}

if (-Not $ISWindows) {
if (-Not $IsWindows) {
Write-Warning $Strings.WindowsOnly
#bail out
Return
Expand Down Expand Up @@ -124,12 +125,15 @@ class PSWorkItemDatabase {
[String]$Encoding
[int32]$PageCount
[int32]$PageSize
[version]$SQLiteVersion
[string]$CreatedBy
}

#endregion

#region type extensions

Update-TypeData -TypeName PSWorkItemDatabase -MemberType ScriptProperty -MemberName ModifiedAge -Value {New-TimeSpan -start $this.LastModified -end (Get-Date)} -Force
Update-TypeData -TypeName PSWorkItemCategory -MemberType ScriptProperty -MemberName ANSIString -Value { $PSWorkItemCategory[$this.Category] -replace "`e",
"``e" } -force
#endregion
Expand Down
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,17 @@ Install the PSWorkItem module from the PowerShell Gallery.
Install-Module PSWorkItem [-scope CurrentUser]
```

Or if you are using the PSResourceGet module.

```powershell
Install-PSResource PSWorkItem
```

:heavy_exclamation_mark: Module installation will also install the required [MySQLite](https://github.com/jdhitsolutions/MySQLite) module from the PowerShell Gallery.

## PSWorkItem Database Change

**If you were using a version of this module prior to v1.0.0, this note applies to you.**
**If you were using a version of this module older than 1.0.0, this note applies to you.**

>Version 1.0.0 of the PSWorkItem module introduced a structural change to the database tables. If you are using a database created in an earlier version, you need to run [Update-PSWorkItemDatabase](docs/Update-PSWorkItemDatabase.md) before adding, changing, or completing work items. You should back up your database file before running this command.
> Alternatively, you could export your work items, delete the database file, initialize a new one, and re-import your work items.
Expand All @@ -37,6 +43,7 @@ Install-Module PSWorkItem [-scope CurrentUser]
- [Get-PSWorkItemReport](docs/Get-PSWorkItemReport.md)
- [Initialize-PSWorkItemDatabase](docs/Initialize-PSWorkItemDatabase.md)
- [New-PSWorkItem](docs/New-PSWorkItem.md)
- [Open-PSWorkItemConsole](docs/Open-PSWorkItemConsole.md)
- [Remove-PSWorkItem](docs/Remove-PSWorkItem.md)
- [Remove-PSWorkItemArchive](docs/Remove-PSWorkItemArchive.md)
- [Remove-PSWorkItemCategory](docs/Remove-PSWorkItemCategory.md)
Expand Down Expand Up @@ -142,7 +149,21 @@ PS C:\> Get-PSWorkItemDatabase
Created LastModified Tasks Archived Categories
------- ------------ ----- -------- ----------
7/30/2023 1:55:02 PM 9/12/2023 1:05:26 PM 13 35 12
7/30/2022 1:55:10 PM 10/6/2023 8:47:22 AM 15 49 12
PS C:\> Get-PSWorkItemDatabase | Format-List
Path : C:\Users\Jeff\PSWorkItem.db
Created : 7/30/2022 1:55:10 PM
LastModified : 10/6/2023 8:47:22 AM
Size : 45056
TaskCount : 15
CategoryCount : 12
ArchiveCount : 49
Encoding : UTF-8
PageCount : 11
PageSize : 4096
ModifiedAge : 00:46:29.3572634
```

## Categories
Expand Down Expand Up @@ -312,7 +333,7 @@ Version 1.3.0 added a management console based on the [Terminal.Gui](https://git

![console management](images/psworkitemconsole.png)

Run [`Open-PSWorkItemConsole`](docs\Open-PSWorkItemConsole.md) or its alias *`wic`*. The form will open with your default database. You can type a new database path or use the Open Database command under Options. The file must end in `.db`. If you select a different database, you can use `Options - Reset Form` to reset to your default database.
Run [`Open-PSWorkItemConsole`](docs\Open-PSWorkItemConsole.md) or its alias *`wic`*. The form will open with your default database. You can type a new database path or use the `Open Database`` command under Options. The file must end in `.db`. If you select a different database, you can use `Options - Reset Form` to reset to your default database.

If you select an item from the table, it will populate the form fields. You can then update, complete, or remove the item. To create a new item, it is recommended that you first clear the form (`Options - Clear Form`). Enter the PSWorkItem details and click the `Add PSWorkItem` button.

Expand Down Expand Up @@ -379,7 +400,7 @@ This module has no specific commands for backing up or restoring a database file
Export-MySQLiteDB -path $PSWorkItemPath -Destination d:\backups\pwi.json
```

Use `Import-MySQLiteDB` to import the file and rebuild the database file. When restoring a database file, you should restore the file to a new location, verify the database, then copy the file to `$PSWorkItemPath`.
Use `Import-MySQLiteDB` to import the file and rebuild the database file. When restoring a database file, you should restore the file to a new location, verify the database, and then copy the file to `$PSWorkItemPath`.

## Database Sample

Expand Down Expand Up @@ -410,6 +431,6 @@ rowid : 19
## Future Tasks or Commands

- Password protection options.
- Update the TUI management console to show database details
- enhancements to the TUI management console

If you have an enhancement suggestion, please submit it as an [Issue](https://github.com/jdhitsolutions/PSWorkItem/issues).
Binary file modified assemblies/Terminal.Gui.dll
Binary file not shown.
22 changes: 21 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,25 @@

## [Unreleased]

## [1.6.0] - 2024-01-04

### Added
- Added private helper functions to create and use a stopwatch. Modified functions to display a verbose message at the end of the command showing how long the function took to run.
- Added menu option in `Open-PSWorkItemConsole` to display database details.

### Changed

- Updated `Open-PSWorkItemConsole` to highlight labels of required values in magenta.
- Updated `Open-PSWorkItemConsole` to use string data.
- Updated the TUI console to display tooltips in the status bar on mouseovers.
- Modified `Open-PSWorkItemConsole` to export internal variables to the global scope when using `-Debug`. After closing the window you can use `$wicWindow` and `$wicControls` to help debug, troubleshoot, or develop the TUI form.
- Modified category report in `Open-PSWorkItemConsole` to use a TextView control in place of a label so that it doesn't lay on the top of other controls.
- Updated Terminal.Gui assembly to version 1.14.1
- Revised the command help displayed in `Open-PSWorkItemConsole`.
- Modified the `Created` property of the `PSWorkItemDatabase` class to use the value from the database metadata instead of relying on the file creation age.
- Modified `PSWorkItemDatabase` class to show additional information. The default formatting won't change, but you'll see additional properties if you pipe to `Select-Object` and select all properties.
- Updated `README.md`.

## [1.5.0] - 2023-10-06

### Added
Expand Down Expand Up @@ -265,7 +284,8 @@ This is a major update with significant changes. If this is your first time inst
- Initial files
- Created Module outline

[Unreleased]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.5.0..HEAD
[Unreleased]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.6.0..HEAD
[1.6.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.5.0..v1.6.0
[1.5.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.4.0..v1.5.0
[1.4.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.3.1..v1.4.0
[1.3.1]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.3.0..v1.3.1
Expand Down
25 changes: 13 additions & 12 deletions docs/Get-PSWorkItemDatabase.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ Use this command to get a summary of the PSWorkItem database file. You can not m
```powershell
PS C:\> Get-PSWorkItemDatabase
Path: C:\Users\Jeff\PSWorkItem.db [32KB]
Path: C:\Users\Jeff\PSWorkItem.db [44KB]
Created LastModified Tasks Archived Categories
------- ------------ ----- -------- ----------
7/29/2023 9:59:59 AM 7/30/2023 11:20:17 AM 6 6 5
Created LastModified Tasks Archived Categories
------- ------------ ----- -------- ----------
7/30/2022 1:55:10 PM 10/6/2023 8:47:22 AM 15 49 12
```

The default summary.
Expand All @@ -43,18 +43,19 @@ The default summary.
PS C:\> Get-PSWorkItemDatabase | Format-List
Path : C:\Users\Jeff\PSWorkItem.db
Created : 7/29/2023 9:59:59 AM
LastModified : 7/30/2023 11:20:17 AM
Size : 32768
TaskCount : 6
CategoryCount : 5
ArchiveCount : 6
Created : 7/30/2022 1:55:10 PM
LastModified : 10/6/2023 8:47:22 AM
Size : 45056
TaskCount : 15
CategoryCount : 12
ArchiveCount : 49
Encoding : UTF-8
PageCount : 8
PageCount : 11
PageSize : 4096
ModifiedAge : 00:46:29.3572634
```

There are additional properties.
There are additional properties. The ModifiedAge property is a time span that shows how long ago the database was last modified.

## PARAMETERS

Expand Down
2 changes: 1 addition & 1 deletion docs/Open-PSWorkItemConsole.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable
You cannot specify a PSWorkItem completion date using this tool.
If you have difficulty seeing the cursor in text fields, and you are running in Windows Terminal, you might try changing the cursor in your Windows Terminal profile setting. The TUI color scheme is also influenced by the Windows Terminal color scheme. It will have a different appearance under different Windows Terminal color schemes.
If you have difficulty seeing the cursor in text fields, and you are running in Windows Terminal, you might try changing the cursor in your Windows Terminal profile setting. The TUI color scheme is also influenced by the Windows Terminal color scheme. It will have a different appearance under different Windows Terminal color schemes. You may also have to adjust the zoom level in Windows Terminal to see the entire form.
IMPORTANT: This command relies on a specific version of Terminal.Gui assembly. You might encounter version conflicts from modules that use older versions of this assembly like Microsoft.PowerShell.ConsoleGuiTools. You may need to load this module first in a new PowerShell session.
Expand Down
29 changes: 15 additions & 14 deletions en-us/PSWorkItem-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1494,11 +1494,11 @@ Event Conference, webinar, or other event 12</dev:code>
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Get-PSWorkItemDatabase

Path: C:\Users\Jeff\PSWorkItem.db [32KB]
Path: C:\Users\Jeff\PSWorkItem.db [44KB]

Created LastModified Tasks Archived Categories
------- ------------ ----- -------- ----------
7/29/2023 9:59:59 AM 7/30/2023 11:20:17 AM 6 6 5</dev:code>
Created LastModified Tasks Archived Categories
------- ------------ ----- -------- ----------
7/30/2022 1:55:10 PM 10/6/2023 8:47:22 AM 15 49 12</dev:code>
<dev:remarks>
<maml:para>The default summary.</maml:para>
</dev:remarks>
Expand All @@ -1508,17 +1508,18 @@ Created LastModified Tasks Archived Categories
<dev:code>PS C:\&gt; Get-PSWorkItemDatabase | Format-List

Path : C:\Users\Jeff\PSWorkItem.db
Created : 7/29/2023 9:59:59 AM
LastModified : 7/30/2023 11:20:17 AM
Size : 32768
TaskCount : 6
CategoryCount : 5
ArchiveCount : 6
Created : 7/30/2022 1:55:10 PM
LastModified : 10/6/2023 8:47:22 AM
Size : 45056
TaskCount : 15
CategoryCount : 12
ArchiveCount : 49
Encoding : UTF-8
PageCount : 8
PageSize : 4096</dev:code>
PageCount : 11
PageSize : 4096
ModifiedAge : 00:46:29.3572634</dev:code>
<dev:remarks>
<maml:para>There are additional properties.</maml:para>
<maml:para>There are additional properties. The ModifiedAge property is a time span that shows how long ago the database was last modified.</maml:para>
</dev:remarks>
</command:example>
</command:examples>
Expand Down Expand Up @@ -2429,7 +2430,7 @@ ColumnIndex ColumnName ColumnType
<maml:alertSet>
<maml:alert>
<maml:para>You cannot specify a PSWorkItem completion date using this tool.</maml:para>
<maml:para>If you have difficulty seeing the cursor in text fields, and you are running in Windows Terminal, you might try changing the cursor in your Windows Terminal profile setting. The TUI color scheme is also influenced by the Windows Terminal color scheme. It will have a different appearance under different Windows Terminal color schemes.</maml:para>
<maml:para>If you have difficulty seeing the cursor in text fields, and you are running in Windows Terminal, you might try changing the cursor in your Windows Terminal profile setting. The TUI color scheme is also influenced by the Windows Terminal color scheme. It will have a different appearance under different Windows Terminal color schemes. You may also have to adjust the zoom level in Windows Terminal to see the entire form.</maml:para>
<maml:para>IMPORTANT: This command relies on a specific version of Terminal.Gui assembly. You might encounter version conflicts from modules that use older versions of this assembly like Microsoft.PowerShell.ConsoleGuiTools. You may need to load this module first in a new PowerShell session.</maml:para>
</maml:alert>
</maml:alertSet>
Expand Down
Loading

0 comments on commit 549b324

Please sign in to comment.