Skip to content

Commit

Permalink
v1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Mar 13, 2023
1 parent 9d6243b commit 97cbb0a
Show file tree
Hide file tree
Showing 13 changed files with 108 additions and 39 deletions.
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.0.0'
ModuleVersion = '1.0.1'
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 find 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 platform.'
PowerShellVersion = '7.2'
DotNetFrameworkVersion = '4.6'
ProcessorArchitecture = 'Amd64'
Expand Down
7 changes: 3 additions & 4 deletions PSWorkItem.psm1
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

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

Expand All @@ -11,7 +10,7 @@ ForEach-Object {
<#
classes for PSWorkItem and PSWorkItemArchive
#>
#define item class
#define base PSWorkItem class
class PSWorkItemBase {
[int]$ID
[String]$Name
Expand Down Expand Up @@ -87,13 +86,13 @@ $global:PSWorkItemCategory = @{

Register-ArgumentCompleter -CommandName New-PSWorkItem, Get-PSWorkItem, Set-PSWorkItem, Get-PSWorkItemArchive,Remove-PSWorkItemArchive -ParameterName Category -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)
#PowerShell code to populate $wordtoComplete
#PowerShell code to populate $WordToComplete
Get-PSWorkItemCategory | Where-Object { $_.category -Like "$wordToComplete*" } |
Select-Object -Property Category, @{Name = "Description"; Expression = {
$_.description -match "\w+" ? $_.description : "no description" }
} |
ForEach-Object {
# completion text,listitem text,result type,Tooltip
# completion text,ListItem text,result type,Tooltip
[System.Management.Automation.CompletionResult]::new($_.category, $_.category, 'ParameterValue', $_.description)
}
}
14 changes: 13 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@

## [Unreleased]

## [1.0.1] - 2023-03-13

### Changed

- Minor help corrections.
- Added missing online help links.

### Fixed

- Fixed warning message in `Get-PSWorkItemArchive`

## [1.0.0] - 2023-03-12

This is a major update with significant changes. If this is your first time installing the module, no further action is required. If you are upgrading from a previous version of this module, you will need to run `Update-PSWorkItemDatabase`. See the [README](README.md) file for more information.
Expand Down Expand Up @@ -167,7 +178,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.0.0..HEAD
[Unreleased]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.0.1..HEAD
[1.0.1]: https://github.com/jdhitsolutions/PSWorkItem/compare/v1.0.0..v1.0.1
[1.0.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v0.9.0..v1.0.0
[0.9.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v0.8.0..v0.9.0
[0.8.0]: https://github.com/jdhitsolutions/PSWorkItem/compare/v0.7.0..v0.8.0
Expand Down
2 changes: 1 addition & 1 deletion docs/Get-PSWorkItemReport.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSWorkItem-help.xml
Module Name: PSWorkItem
online version:
online version: https://bit.ly/3YB7fQk
schema: 2.0.0
---

Expand Down
18 changes: 13 additions & 5 deletions docs/Remove-PSWorkItemArchive.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
external help file: PSWorkItem-help.xml
Module Name: PSWorkItem
online version:
online version: https://bit.ly/3TdOFMX
schema: 2.0.0
---

# Remove-PSWorkItemArchive

## SYNOPSIS

Remove archive PSWorkItems

## SYNTAX
Expand Down Expand Up @@ -41,8 +42,8 @@ Completed work items are moved to the Archive table in the PSWorkItem database.
```powershell
PS C:\> Remove-PSWorkItem -id 7 -Verbose
VERBOSE: [12:37:40.2036443 BEGIN ] Remove-PSWorkItem: Starting
VERBOSE: [12:37:40.2045322 BEGIN ] Remove-PSWorkItem: PSBoundparameters
VERBOSE:
VERBOSE: [12:37:40.2045322 BEGIN ] Remove-PSWorkItem: PSBoundParameters
VERBOSE:
Key Value
--- -----
ID 7
Expand All @@ -53,7 +54,7 @@ VERBOSE: [12:37:40.2099707 BEGIN ] Remove-PSWorkItem: Opening a connection to C
VERBOSE: [12:37:40.2142745 PROCESS] Remove-PSWorkItem: Removing task 7
VERBOSE: Performing the operation "Remove-PSWorkItem" on target "1a2d1acc-738d-458f-8744-6a6e541a8bc5".
VERBOSE: [12:37:40.2245915 END ] Remove-PSWorkItem: Closing database connection.
VERBOSE: [12:37:40.2261433 END ] Remove-PSWorkItem: Ending
VERBOSE: [12:37:40.2261433 END ] Remove-PSWorkItem: Ending
```

Delete an archived item by its ID.
Expand Down Expand Up @@ -81,6 +82,7 @@ Remove archived items where the name end in 'report'.
## PARAMETERS

### -Category

A PSWorkItem category.

```yaml
Expand All @@ -96,6 +98,7 @@ Accept wildcard characters: False
```
### -Confirm
Prompts you for confirmation before running the cmdlet.
```yaml
Expand All @@ -111,6 +114,7 @@ Accept wildcard characters: False
```
### -ID
The archive work item ID.
```yaml
Expand All @@ -126,8 +130,9 @@ Accept wildcard characters: False
```
### -Name
The name of the archive work item.
Wilcards are supported.
Wildcards are supported.
```yaml
Type: String
Expand All @@ -142,6 +147,7 @@ Accept wildcard characters: True
```
### -Path
The path to the PSWorkItem SQLite database file.
It should end in .db
Expand All @@ -158,6 +164,7 @@ Accept wildcard characters: False
```
### -WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
Expand All @@ -174,6 +181,7 @@ 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](http://go.microsoft.com/fwlink/?LinkID=113216).
## INPUTS
Expand Down
2 changes: 1 addition & 1 deletion docs/Update-PSWorkItemDatabase.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
external help file: PSWorkItem-help.xml
Module Name: PSWorkItem
online version:
online version: https://bit.ly/3ThCJtF
schema: 2.0.0
---

Expand Down
20 changes: 16 additions & 4 deletions en-us/PSWorkItem-help.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1599,6 +1599,10 @@ Count Category PctTotal
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://bit.ly/3YB7fQk</maml:uri>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Get-PSWorkItem</maml:linkText>
<maml:uri></maml:uri>
Expand Down Expand Up @@ -2522,7 +2526,7 @@ ColumnIndex ColumnName ColumnType
<command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="task">
<maml:name>Name</maml:name>
<maml:description>
<maml:para>The name of the archive work item. Wilcards are supported.</maml:para>
<maml:para>The name of the archive work item. Wildcards are supported.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
Expand Down Expand Up @@ -2607,7 +2611,7 @@ ColumnIndex ColumnName ColumnType
<command:parameter required="false" variableLength="true" globbing="true" pipelineInput="False" position="0" aliases="task">
<maml:name>Name</maml:name>
<maml:description>
<maml:para>The name of the archive work item. Wilcards are supported.</maml:para>
<maml:para>The name of the archive work item. Wildcards are supported.</maml:para>
</maml:description>
<command:parameterValue required="true" variableLength="false">String</command:parameterValue>
<dev:type>
Expand Down Expand Up @@ -2671,8 +2675,8 @@ ColumnIndex ColumnName ColumnType
<maml:title>-------------------------- Example 1 --------------------------</maml:title>
<dev:code>PS C:\&gt; Remove-PSWorkItem -id 7 -Verbose
VERBOSE: [12:37:40.2036443 BEGIN ] Remove-PSWorkItem: Starting
VERBOSE: [12:37:40.2045322 BEGIN ] Remove-PSWorkItem: PSBoundparameters
VERBOSE:
VERBOSE: [12:37:40.2045322 BEGIN ] Remove-PSWorkItem: PSBoundParameters
VERBOSE:
Key Value
--- -----
ID 7
Expand Down Expand Up @@ -2708,6 +2712,10 @@ What if: Performing the operation "Remove-PSWorkItemArchive" on target "19fea3ee
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://bit.ly/3TdOFMX</maml:uri>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Remove-PSWorkItem</maml:linkText>
<maml:uri></maml:uri>
Expand Down Expand Up @@ -3404,6 +3412,10 @@ ID Name Description DueDate Category Pct
</command:example>
</command:examples>
<command:relatedLinks>
<maml:navigationLink>
<maml:linkText>Online Version:</maml:linkText>
<maml:uri>https://bit.ly/3ThCJtF</maml:uri>
</maml:navigationLink>
<maml:navigationLink>
<maml:linkText>Get-PSWorkItemDatabase</maml:linkText>
<maml:uri></maml:uri>
Expand Down
4 changes: 2 additions & 2 deletions functions/public/Complete-PSWorkItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Function Complete-PSWorkItem {
)
Begin {
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Starting"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundparameters"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundParameters"
$PSBoundParameters | Out-String | Write-Verbose
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Opening a connection to $Path"
Try {
Expand Down Expand Up @@ -98,7 +98,7 @@ Function Complete-PSWorkItem {
Close-MySQLiteDB $conn
Throw $_
}

#Validate the copy using the task GUID
$splat.query = "SELECT * from archive WHERE taskid='$($task.taskid)'"
Write-Verbose "[$((Get-Date).TimeOfDay) PROCESS] $($MyInvocation.MyCommand): Validating the move"
Expand Down
2 changes: 1 addition & 1 deletion functions/public/Get-PSWorkItemArchive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Function Get-PSWorkItemArchive {
#test if archive table has been updated to include the OriginalTaskID column
$test = Invoke-MySQLiteQuery -Path $path -query "pragma table_info('archive')" | Where-Object name -eq 'id'
if (-Not $test) {
Write-Warning "Cannot verify the archive table column ID. Please run Update-PSWorkItemArchive to update the table then try completing the command again. It is recommended that you backup your database before updating the table."
Write-Warning "Cannot verify the archive table column ID. Please run Update-PSWorkItemDatabase to update the table then try completing the command again. It is recommended that you backup your database before updating the table."
Return
}
Switch ($PSCmdlet.ParameterSetName) {
Expand Down
2 changes: 1 addition & 1 deletion functions/public/Remove-PSWorkItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Function Remove-PSWorkItem {
)
Begin {
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Starting"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundparameters"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundParameters"
$PSBoundParameters | Out-String | Write-Verbose
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Opening a connection to $Path"
Try {
Expand Down
7 changes: 3 additions & 4 deletions functions/public/Remove-PSWorkItemArchive.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Function Remove-PSWorkItemArchive {

[Parameter(
Position = 0,
HelpMessage = "The name of the archive work item. Wilcards are supported.",
HelpMessage = "The name of the archive work item. Wildcards are supported.",
ParameterSetName = "name"
)]
[ValidateNotNullOrEmpty()]
Expand All @@ -48,7 +48,7 @@ Function Remove-PSWorkItemArchive {
)
Begin {
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Starting"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundparameters"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundParameters"
$PSBoundParameters | Out-String | Write-Verbose
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Opening a connection to $Path"
Try {
Expand All @@ -68,7 +68,6 @@ Function Remove-PSWorkItemArchive {
} #begin

Process {

Switch ($PSCmdlet.ParameterSetName) {
"id" {
Write-Verbose "[$((Get-Date).TimeOfDay) PROCESS] $($MyInvocation.MyCommand): Removing archived task $ID"
Expand All @@ -87,7 +86,7 @@ Function Remove-PSWorkItemArchive {
}
$splat.query = "SELECT * FROM archive WHERE name like '$name' collate nocase"
$warn = "Failed to find any archived work items called $name"
}
}
}

Write-Verbose "[$((Get-Date).TimeOfDay) PROCESS] $($splat.query)"
Expand Down
2 changes: 1 addition & 1 deletion functions/public/Set-PSWorkItem.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Function Set-PSWorkItem {
)
Begin {
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Starting"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundparameters"
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): PSBoundParameters"
$PSBoundParameters | Out-String | Write-Verbose
Write-Verbose "[$((Get-Date).TimeOfDay) BEGIN ] $($MyInvocation.MyCommand): Opening a connection to $Path"
Try {
Expand Down
Loading

0 comments on commit 97cbb0a

Please sign in to comment.