Skip to content

Commit

Permalink
v1.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Feb 23, 2024
1 parent e8ed786 commit b0f9d6b
Show file tree
Hide file tree
Showing 30 changed files with 495 additions and 74 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
8 changes: 4 additions & 4 deletions PSWorkItem.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@

@{
RootModule = 'PSWorkItem.psm1'
ModuleVersion = '1.7.0'
ModuleVersion = '1.8.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. 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.'
PowerShellVersion = '7.3'
DotNetFrameworkVersion = '4.6'
ProcessorArchitecture = 'Amd64'
RequiredModules = "mySQLite"
RequiredModules = 'mySQLite'
TypesToProcess = @(
'types\psworkitem.types.ps1xml',
'types\psworkitemarchive.types.ps1xml'
Expand Down Expand Up @@ -59,7 +59,7 @@
# ReleaseNotes = ''
# Prerelease = ''
# RequireLicenseAcceptance = $false
ExternalModuleDependencies = "MySQLite"
ExternalModuleDependencies = 'mySQLite'
} # End of PSData hashtable

} # End of PrivateData hashtable
Expand Down
9 changes: 5 additions & 4 deletions PSWorkItem.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ if ((Get-Culture).Name -match "\w+") {
}
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
Import-LocalizedData -BindingVariable strings -FileName PSWorkItem.psd1 -BaseDirectory $PSScriptRoot\en-us
}

if (-Not $ISWindows) {
Write-Warning $Strings.WindowsOnly
#Adding a failsafe check for Windows PowerShell
if ($IsMacOS -or ($PSEdition -eq "Desktop")) {
Write-Warning $Strings.Unsupported
#bail out
Return
}
Expand Down Expand Up @@ -47,7 +48,7 @@ foreach ($dll in $dlls) {
Switch ($Name) {
"NStack.dll" {
#get currently loaded version
$ver = [System.Reflection.Assembly]::GetAssembly([nstack.ustring]).GetName().version
$ver = [System.Reflection.Assembly]::GetAssembly([NStack.uString]).GetName().version
if ($ver -lt $NStackVersion) {
$Detail = $strings.WarnDetected -f $ver,$NStackVersion,$PSStyle.Foreground.Red,$PSStyle.Foreground.Green,$PSStyle.Italic,$PSStyle.Reset
}
Expand Down
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,23 @@

[![PSGallery Version](https://img.shields.io/powershellgallery/v/PSWorkItem.png?style=for-the-badge&label=PowerShell%20Gallery)](https://www.powershellgallery.com/packages/PSWorkItem/) [![PSGallery Downloads](https://img.shields.io/powershellgallery/dt/PSWorkItem.png?style=for-the-badge&label=Downloads)](https://www.powershellgallery.com/packages/PSWorkItem/)

This module is a replacement for the [MyTasks](https://github.com/jdhitsolutions/MyTasks) module. The original PowerShell module offered simple task or to-do management. All data was stored in XML files. This module conceptually is designed the same way but instead uses a SQLite database file. The module commands are wrapped around functions from the MySQLite module.
This module is a replacement for the [MyTasks](https://github.com/jdhitsolutions/MyTasks) module. The original PowerShell module offered simple tasks or to-do management. All data was stored in XML files. This module conceptually is designed the same way but instead uses a SQLite database file. The module commands are wrapped around functions from the [MySQLite](https://github.com/jdhitsolutions/MySQLite) module.

## Installation

This module requires __PowerShell 7.3__ or later and a 64-bit version of PowerShell, which I assume most people are running. __The module requires a Windows platform__ until the dependency SQLite module [supports non-Windows systems](https://github.com/jdhitsolutions/MySQLite/issues/21).
This module requires __PowerShell 7.3__ or later and a 64-bit version of PowerShell, which I assume most people are running. __The module requires a Windows or Linux platform__ until the dependency SQLite module [supports other non-Windows systems](https://github.com/jdhitsolutions/MySQLite/issues/21).

Install the PSWorkItem module from the PowerShell Gallery.

```powershell
Install-Module PSWorkItem [-scope CurrentUser]
```

:heavy_exclamation_mark: Module installation will also install the required [MySQLite](https://github.com/jdhitsolutions/MySQLite) module from the PowerShell Gallery.
:heavy_exclamation_mark: Module installation will also install the required [MySQLite](https://github.com/jdhitsolutions/MySQLite) module from the PowerShell Gallery. Linux support was added in `MySQLite v0.13.0`.

## 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 v1.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 +37,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 All @@ -61,7 +62,7 @@ ColumnIndex ColumnName ColumnType
8 completed integer
```

When items are queried from this table using `Get-PSWorkItem` they are written to the pipeline as a `PSWorkItem` object. This is a class-based object defined in the root module.
When items are queried from this table using `Get-PSWorkItem` they are written to the pipeline as `PSWorkItem` objects. This is a class-based object defined in the root module.

> These definitions were revised for v1.0.0.
Expand Down Expand Up @@ -109,7 +110,7 @@ ColumnIndex ColumnName ColumnType

You __must__ define categories with `Add-PSWorkItemCategory` before you can create a new task. Categories are written to the pipeline as `PSWorkItemCategory` objects, also defined with a PowerShell class.

```powershell
```shell
class PSWorkItemCategory {
[String]$Category
[String]$Description
Expand All @@ -135,7 +136,7 @@ To get started, run `Initialize-PSWorkItemDatabase`. This will create a new data

You can view a database summary with `Get-PSWorkItemDatabase`.

```powershell
```shell
PS C:\> Get-PSWorkItemDatabase

Path: C:\Users\Jeff\PSWorkItem.db [44KB]
Expand All @@ -155,7 +156,7 @@ Add-PSWorkItemCategory -Category "SRV" -Description "server management tasks"

Use `Get-PSWorkItemCategory` to view your categories.

```powershell
```shell
PS C:\> Get-PSWorkItemCategory

Category Description
Expand All @@ -172,7 +173,7 @@ If you need to update a category, you can re-add it using `-Force`.

> The category name is case-sensitive.
```powershell
```shell
PS C:\> Add-PSWorkItemCategory -Category Work -Description "business-related tasks" -PassThru -Force

Category Description
Expand Down Expand Up @@ -245,7 +246,7 @@ Category highlighting is only available in the default view.

Use [Set-PSWorkItem](docs/Set-PSWorkItem.md) or its alias `swi` to update a task based on its ID.

```powershell
```shell
PS C:\> Set-PSWorkItem -id 7 -Progress 30 -DueDate "8/15/2023 12:00PM" -PassThru

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -259,7 +260,7 @@ ID Name Description DueDate Category Pct

When a task is complete, you can move it to the `Archive` table.

```powershell
```shell
PS C:\> Complete-PSWorkItem -id 7 -PassThru

Database: C:\Users\Jeff\PSWorkItem.db
Expand Down Expand Up @@ -288,7 +289,7 @@ Beginning with v1.0.0, you can use [Remove-PSWorkItemArchive](docs/Remove-PSWork

You can use [Get-PSWorkItemReport](docs/Get-PSWorkItemReport.md) to get a summary report of open work items grouped by category.

```powershell
```shell
PS C:\> Get-PSWorkItemReport

Path: C:\Users\Jeff\PSWorkItem.db
Expand Down Expand Up @@ -352,7 +353,7 @@ $global:PSDefaultParameterValues["New-PSWorkItem:Category"] = $importPref.Defaul

Use `Get-PSWorkItemPreference` to view.

```powershell
```shell
PS C:\> Get-PSWorkItemPreference

Path: C:\Users\Jeff\PSWorkItem.db [Default Days: 7 Default Category: Work]
Expand All @@ -369,7 +370,7 @@ Personal `e[32m
The categories are only those where you have customized an ANSI sequence. On module import, these categories will be used to populate `$PSWorkItemCategory.` If you make any changes to your preference, re-run `Update-PSWorkItemPreference`.
> It is possible you will need to manually delete the JSON preferences file if you uninstall the module.
> You might need to manually delete the JSON preferences file if you uninstall the module.
## Database Backup
Expand All @@ -379,7 +380,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 All @@ -391,7 +392,7 @@ If you copy the sample to `$PSWorkItemPath`, delete the file before creating you
Most of the commands in this module create custom objects derived from PowerShell [class definitions](PSWorkItem.psm1) and data in the SQLite database file. If you need to troubleshoot a problem, you can use `Get-PSWorkItemData` to select all data from one of the three tables.
```powershell
```shell
PS C:\> Get-PSWorkItemData
taskid : 2196617b-b818-415d-b9cc-52b0c649a77e
Expand All @@ -410,6 +411,5 @@ rowid : 19
## Future Tasks or Commands
- Password protection options.
- Update the TUI management console to show database details
If you have an enhancement suggestion, please submit it as an [Issue](https://github.com/jdhitsolutions/PSWorkItem/issues).
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.8.0] - 2024-02-23

### Added

- Added `mySQLite` module version to the About display in `Open-POSWorkItemConsole`.
- Added an `about_psworkitem` help topic
- Added support for running on Linux-x64 platforms.

### Changed

- Updated `Open-PSWorkItemConsole` to use the `$PSWorkItemDefaultDays` value instead of the hard-coded 30.
- Updated help documentation
- Updated `README.md`.
- Revised module description.

### Fixed

- Fixed bug importing localized data on non-Windows systems.

## [1.7.0] - 2024-01-07

### Changed
Expand Down Expand Up @@ -280,7 +299,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.7.0..HEAD
[Unreleased]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.8.0..HEAD
[1.8.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.7.0..v1.8.0
[1.7.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.5.0..v1.7.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
Expand Down
2 changes: 1 addition & 1 deletion docs/Add-PSWorkItemCategory.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ It is recommended that you use proper casing for your category names and that th

### Example 1

```powershell
```shell
PS C:\> Add-PSWorkItemCategory -Name Blog -Description "blog management and content" -PassThru

Category Description
Expand Down
4 changes: 2 additions & 2 deletions docs/Complete-PSWorkItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When you are ready to mark a task as complete, use this command. Complete-PSWork

### Example 1

```powershell
```shell
PS C:\> Complete-PSWorkItem -id 9 -PassThru

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -38,7 +38,7 @@ Mark a PSWorkItem as completed and move it to the Archive table. The PSWorkItem

### Example 2

```powershell
```shell
PS C:\> Get-PSWorkItem -category Alpha | Complete-WorkItem
```

Expand Down
16 changes: 8 additions & 8 deletions docs/Get-PSWorkItem.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This command will retrieve PSWorkItems from the database using a parameter defin

### Example 1

```powershell
```shell
PS C:\> Get-PSWorkItem

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -67,7 +67,7 @@ Get all items due in the next 10 days.

### Example 2

```powershell
```shell
PS C:\> Get-PSWorkItem -all

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -86,7 +86,7 @@ Get all open tasks.

### Example 3

```powershell
```shell
PS C:\> Get-PSWorkItem -Category Work

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -102,7 +102,7 @@ Get tasks from the Work category.

### Example 4

```powershell
```shell
PS C:\> Get-PSWorkItem -id 9

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -116,7 +116,7 @@ Get a PSWorkItem by its ID.

### Example 5

```powershell
```shell
PS C:\> Get-PSWorkItem -Name p*

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -131,7 +131,7 @@ Get PSWorkItems with a name that begins with P.

### Example 6

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

ID Name Description DueDate TimeRemaining
Expand All @@ -145,7 +145,7 @@ The PSWorkItem has a named table view called Countdown.

### Example 7

```powershell
```shell
PS C:\> Get-PSWorkItem | Where Overdue

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -161,7 +161,7 @@ Get all overdue PSWorkItems.

### Example 8

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

Category: Other
Expand Down
4 changes: 2 additions & 2 deletions docs/Get-PSWorkItemArchive.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ Completed PSWorkItems are moved to the Archive table. Using this command to view

### Example 1

```powershell
```shell
PS C:\> Get-PSWorkItemArchive

Database: C:\Users\Jeff\PSWorkItem.db
Expand All @@ -58,7 +58,7 @@ Get all archived PSWorkItems.

### Example 2

```powershell
```shell
PS C:\> Get-PSWorkItemArchive -Category Personal

Database: C:\Users\Jeff\PSWorkItem.db
Expand Down
6 changes: 3 additions & 3 deletions docs/Get-PSWorkItemCategory.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ When you create a PSWorkItem, you need to tag it with a category. The category m

### Example 1

```powershell
```shell
PS C:\> Get-PSWorkItemCategory

Category Description
Expand All @@ -45,7 +45,7 @@ Get all defined categories.

### Example 2

```powershell
```shell
PS C:\> Get-PSWorkItemCategory blog

Category Description
Expand All @@ -57,7 +57,7 @@ Get information about a single category.

### Example 3

```powershell
```shell
PS C:\> Get-PSWorkItemCategory | Select-Object Category,ANSIString

Category ANSIString
Expand Down
Loading

0 comments on commit b0f9d6b

Please sign in to comment.