Skip to content

Commit 518bb7e

Browse files
0.12.0
1 parent eabbbac commit 518bb7e

25 files changed

Lines changed: 701 additions & 358 deletions

PSProjectStatus.psd1

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
@{
44
RootModule = 'PSProjectStatus.psm1'
5-
ModuleVersion = '0.11.1'
5+
ModuleVersion = '0.12.0'
66
CompatiblePSEditions = 'Desktop', 'Core'
77
GUID = 'ec249544-dc4e-4e24-aae8-4281ec84f54d'
88
Author = 'Jeff Hicks'
@@ -11,17 +11,20 @@
1111
Description = 'A set of PowerShell tools for tracking module development status. The module uses a JSON file to create a custom object with information about your module. You can use this internally to track the status of your module including a simple to-do tracker. This module was first described at https://jdhitsolutions.com/blog/powershell/8960/introducing-psprojectstatus/'
1212
PowerShellVersion = '5.1'
1313
TypesToProcess = @('types\psprojectstatus.types.ps1xml')
14-
FormatsToProcess = @('formats\psprojectstatus.format.ps1xml','.\formats\psprojecttask.format.ps1xml')
15-
FunctionsToExport = 'Get-PSProjectStatus', 'New-PSProjectStatus', 'Set-PSProjectStatus', 'Update-PSProjectStatus',
16-
'Get-PSProjectGitStatus','Get-PSProjectReport','Get-PSProjectTask','New-PSProjectTask',
17-
'Remove-PSProjectTask'
18-
AliasesToExport = 'gpstat', 'npstat', 'spstat', 'gitstat'
14+
FormatsToProcess = @('formats\psprojectstatus.format.ps1xml', '.\formats\psprojecttask.format.ps1xml')
15+
FunctionsToExport = @(
16+
'Get-PSProjectStatus', 'New-PSProjectStatus',
17+
'Set-PSProjectStatus', 'Get-PSProjectGitStatus',
18+
'Get-PSProjectReport', 'Get-PSProjectTask',
19+
'New-PSProjectTask', 'Remove-PSProjectTask'
20+
)
21+
AliasesToExport = @('gpstat', 'npstat', 'spstat', 'gitstat', 'Update-PSProjectStatus')
1922
PrivateData = @{
2023
PSData = @{
21-
Tags = @("modules", "scripting", "project-management", "project","psmodule")
24+
Tags = @('modules', 'scripting', 'project-management', 'project', 'psmodule', 'to-do')
2225
LicenseUri = 'https://github.com/jdhitsolutions/PSProjectStatus/blob/main/License.txt'
2326
ProjectUri = 'https://github.com/jdhitsolutions/PSProjectStatus'
24-
# IconUri = ''
27+
IconUri = 'https://raw.githubusercontent.com./jdhitsolutions/PSProjectStatus/main/images/psproject-icon.png'
2528
ReleaseNotes = 'https://github.com/jdhitsolutions/PSProjectStatus/blob/main/changelog.md'
2629
RequireLicenseAcceptance = $false
2730
}

PSProjectStatus.psm1

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,24 @@
1+
# used for culture debugging
2+
# write-host "Importing with culture $(Get-Culture)"
3+
4+
if ((Get-Culture).Name -match "\w+") {
5+
#write-host "Using culture $(Get-Culture)" -ForegroundColor yellow
6+
Import-LocalizedData -BindingVariable strings
7+
}
8+
else {
9+
#force using En-US if no culture found, which might happen on non-Windows systems.
10+
#write-host "Loading $PSScriptRoot/en-us/PSWorkItem.psd1" -ForegroundColor yellow
11+
Import-LocalizedData -BindingVariable strings -FileName psprojectstatus.psd1 -BaseDirectory $PSScriptRoot/en-us
12+
}
13+
14+
115
#dot source functions
216
Get-ChildItem $PSScriptRoot\functions\*.ps1 -Recurse |
317
ForEach-Object {
418
. $_.FullName
519
}
620

21+
722
#region class definitions
823
enum PSProjectStatus {
924
Development
@@ -47,13 +62,14 @@ Class PSProject {
4762
[DateTime]$LastUpdate = (Get-Date)
4863
[string[]]$Tasks = @()
4964
[PSProjectStatus]$Status = 'Development'
50-
[Version]$ProjectVersion = (Test-ModuleManifest ".\$(Split-Path $pwd -Leaf).psd1" -ErrorAction SilentlyContinue).version
65+
[Version]$ProjectVersion = (Test-ModuleManifest -Path ".\$(Split-Path $pwd -Leaf).psd1" -Verbose:$False -ErrorAction SilentlyContinue).version
5166
[string]$GitBranch = ''
5267
#using .NET classes to ensure compatibility with non-Windows platforms
5368
[string]$UpdateUser = "$([System.Environment]::UserDomainName)\$([System.Environment]::Username)"
5469
[string]$Computername = [System.Environment]::MachineName
5570
[PSProjectRemote[]]$RemoteRepository = @()
56-
[string]$Comment = 'none'
71+
[string]$Comment = ''
72+
[string[]]$Tags = @()
5773

5874
[void]Save() {
5975
$json = Join-Path -Path $this.path -ChildPath psproject.json
@@ -64,7 +80,7 @@ Class PSProject {
6480
@{Name = 'LastUpdate'; Expression = { '{0:o}' -f $_.LastUpdate } },
6581
@{Name = 'Status'; Expression = { $_.status.toString() } },
6682
@{Name = 'ProjectVersion'; Expression = { $_.ProjectVersion.toString() } },
67-
UpdateUser, Computername, RemoteRepository, Tasks, GitBranch, Comment |
83+
UpdateUser,Computername,RemoteRepository,Tasks,GitBranch,Tags,Comment |
6884
ConvertTo-Json | Out-File -FilePath $json -Encoding utf8
6985
}
7086
[void]RefreshProjectVersion() {
@@ -271,4 +287,8 @@ if ($host.name -match 'ISE') {
271287
$jsonSchema = 'https://raw.githubusercontent.com/jdhitsolutions/PSProjectStatus/main/psproject.schema.json'
272288

273289
# for testing
274-
# $jsonSchema = "file:///c:/scripts/psprojectstatus/psproject.schema.json"
290+
# $jsonSchema = "file:///c:/scripts/psprojectstatus/psproject.schema.json"
291+
292+
#Export the module version to a global variable that will be used in Verbose messages
293+
New-Variable -Name PSProjectStatusModule -Value "0.12.0" -Description "The PSProjectStatus module version used in verbose messaging."
294+
Export-ModuleMember -Variable PSProjectStatusModule -Alias 'Update-PSProjectStatus','gitstat','gpstat', 'npstat', 'spstat'

README.md

Lines changed: 176 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

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

5-
This PowerShell module is designed to make it easier to manage your projects and modules. It provides a snapshot overview of the project's status. You can use this to quickly determine when you last worked on a module and what high-level tasks remain. Status information is stored in a JSON file that resides in the module's root directory. If you have initialized *git* for the module, the project status will include the current branch.
5+
![icon](images/psproject-icon.png)This PowerShell module is designed to make it easier to manage your projects and modules. It provides a snapshot overview of the project's status. You can use this to quickly determine when you last worked on a module and what high-level tasks remain. Status information is stored in a JSON file that resides in the module's root directory. If you have initialized *git* for the module, the project status will include the current branch.
66

77
## Installation
88

@@ -12,8 +12,25 @@ Install this module from the PowerShell Gallery.
1212
Install-Module PSProjectStatus
1313
```
1414

15+
Or you can use the [`Microsoft.PowerShell.PSResourceGet`](https://github.com/PowerShell/PSResourceGet/) module.
16+
17+
```powershell
18+
Install-PSResource PSProjectStatus -Scope AllUsers
19+
```
20+
1521
This module should work in Windows PowerShell 5.1 and PowerShell 7.
1622

23+
## Module Commands
24+
25+
- [Get-PSProjectGitStatus](docs/Get-PSProjectGitStatus.md)
26+
- [Get-PSProjectReport](docs/Get-PSProjectReport.md)
27+
- [Get-PSProjectStatus](docs/Get-PSProjectStatus.md)
28+
- [Get-PSProjectTask](docs/Get-PSProjectTask.md)
29+
- [New-PSProjectStatus](docs/New-PSProjectStatus.md)
30+
- [New-PSProjectTask](docs/New-PSProjectTask.md)
31+
- [Remove-PSProjectTask](docs/Remove-PSProjectTask.md)
32+
- [Set-PSProjectStatus](docs/Set-PSProjectStatus.md)
33+
1734
## Class-Based
1835

1936
The project status is based on a private class-based definition. The PowerShell classes are used to construct the JSON file which in turn is used to create a `PSProject` object and update its properties.
@@ -49,7 +66,7 @@ Class PSProject {
4966
[string]$UpdateUser = "$([System.Environment]::UserDomainName)\$([System.Environment]::Username)"
5067
[string]$Computername = [System.Environment]::MachineName
5168
[PSProjectRemote[]]$RemoteRepository = @()
52-
[string]$Comment = 'none'
69+
[string]$Comment = ''
5370
5471
[void]Save() {
5572
$json = Join-Path -Path $this.path -ChildPath psproject.json
@@ -158,7 +175,7 @@ The `Age` ScriptProperty and `VersionInfo` property sets are added to the object
158175

159176
To create a project status file, navigate to the module root and run [New-PSProjectStatus](docs/New-PSProjectStatus.md). The default status is `Development`
160177

161-
![new psproject status](images/new-psprojectstatus.png)
178+
![New PSProject Status](images/new-psprojectstatus.png)
162179

163180
You can update properties when you create the project status.
164181

@@ -175,16 +192,18 @@ The command will create `psproject.json` in the root folder.
175192
"$schema": "https://raw.githubusercontent.com/jdhitsolutions/PSProjectStatus/main/psproject.schema.json",
176193
"Name": "PSHelpDesk",
177194
"Path": "C:\\Scripts\\PSHelpDesk",
178-
"LastUpdate": "2022-02-20T09:47:33-05:00",
179-
"Status": 1,
195+
"LastUpdate": "2023-02-20T09:47:33-05:00",
196+
"Status": "Updating",
180197
"ProjectVersion": "0.1.0",
181198
"UpdateUser": "PROSPERO\\Jeff",
182199
"Computername": "PROSPERO",
183-
"RemoteRepository": null,
200+
"RemoteRepository": [],
184201
"Tasks": [
185202
"update help"
186203
],
187-
"GitBranch": "dev"
204+
"GitBranch": "dev",
205+
"Tags : [],
206+
"Comment": ""
188207
}
189208
```
190209

@@ -202,9 +221,9 @@ PS C:\scripts\PSCalendar> Get-PSProjectStatus
202221
203222
Name: PSCalendar [C:\Scripts\PSCalendar]
204223
205-
LastUpdate Status Tasks GitBranch Age
206-
---------- ------ ----- --------- ---
207-
3/3/2022 10:24:49 AM Patching {Update help docu... 2.9.0 12.07:07
224+
LastUpdate Status Tasks GitBranch Age
225+
---------- ------ ----- --------- ---
226+
3/3/2022 10:24:49 AM Patching {Update help docu... 2.9.0 12.07:07
208227
```
209228

210229
If the PowerShell host supports ANSI, a status of `Stable` will be displayed in Green. `Development` will be shown in Red and `Updating` in Yellow.
@@ -262,7 +281,7 @@ PS C:\scripts\PSHelpDesk> Set-PSProjectStatus -LastUpdate (Get-Date) -Status Dev
262281
263282
LastUpdate Status Tasks GitBranch Age
264283
---------- ------ ----- --------- ---
265-
3/15/2022 5:53:54 PM Development {update help, add... dev 00.00:00
284+
3/15/2023 5:53:54 PM Development {update help, add... dev 00.00:00
266285
```
267286

268287
When defining tasks, use `-Concatenate` to append the tasks. Otherwise, tasks will be overwritten with the new value.
@@ -284,7 +303,7 @@ Name : WingetTools
284303
Status : Stable
285304
Version :
286305
GitBranch : main
287-
LastUpdate : 3/17/2022 9:46:35 AM
306+
LastUpdate : 3/17/2023 9:46:35 AM
288307
Age : 9.00:22:39.3936893
289308
Path : C:\Scripts\WingetTools
290309
ProjectVersion :
@@ -293,6 +312,7 @@ Computername :
293312
RemoteRepository : {}
294313
Tasks : {}
295314
Comment :
315+
Tags : {}
296316
```
297317

298318
To update, get a reference to the project status object.
@@ -326,9 +346,9 @@ C:\Scripts\PSProjectStatus> Set-PSProjectStatus -Tasks "Update missing online he
326346
327347
Name: PSProjectStatus [C:\Scripts\PSProjectStatus]
328348
329-
LastUpdate Status Tasks GitBranch Age
330-
---------- ------ ----- --------- ---
331-
12/22/2023 9:08:30 AM Updating {Consider a schema … 0.11.0 00.00:00
349+
LastUpdate Status Tasks GitBranch Age
350+
---------- ------ ----- --------- ---
351+
12/22/2023 9:08:30 AM Updating {Consider a schema … 0.11.0 00.00:00
332352
```
333353

334354
Or you can use the task-related commands.
@@ -418,10 +438,149 @@ LastUpdate Status Tasks GitBranch Age
418438
1/20/2023 2:20:39 PM Stable {convert modu... main 07.23:51
419439
```
420440

441+
## Project Tags
442+
443+
Support for tags was added in version 0.12.0. You can define tags when you create the project status file.
444+
445+
```powershell
446+
New-PSProjectStatus -Tasks "prototype" -Tags tui - -version 0.2.0
447+
```
448+
449+
Or you can add them later.
450+
451+
```powershell
452+
Set-PSProjectStatus -Tags "beta","tui"
453+
```
454+
455+
When using this command you need to redefine existing tags. Or add the tags manually to the JSON file.
456+
457+
You can view tags with a formatted list view.
458+
459+
```powershell
460+
PS C:\work\terminalgui> Get-PSProjectStatus | Format-List
461+
462+
Project: terminalgui [C:\work\terminalgui]
463+
464+
Version : 0.2.0
465+
Status : Development
466+
Tasks : {prototype}
467+
Tags : {beta, tui}
468+
GitBranch :
469+
LastUpdate : 12/27/2023 5:11:30 PM
470+
Age : 00:02:48.0251636
471+
```
472+
473+
You are most likely to use tags when managing multiple projects. `Get-PSProjectReport` includes a `-Tag` parameter so that you can filter from your parent folder.
474+
475+
```powershell
476+
PS C:\> Get-PSProjectReport -path c:\scripts -Tag json
477+
478+
Name: PSProjectStatus [C:\Scripts\PSProjectStatus]
479+
480+
LastUpdate Status Tasks GitBranch Age
481+
---------- ------ ----- --------- ---
482+
12/27/2023 5:16:52 PM Updating {Create TUI-based m… 0.12.0 00.00:00
483+
```
484+
485+
If you want to remove tags, either manually edit the JSON file or use `Set-PSProjectStatus` and set an empty array.
486+
487+
```powershell
488+
Set-PSProjectStatus -Tags @()
489+
```
490+
421491
## Removing Project Status
422492

423493
If no you longer want to track the project status for a given folder, simply delete the associated JSON file. As an alternative, you can set the status to `Archive`.
424494

495+
## Module Extensions
496+
497+
### Type Extensions
498+
499+
The commands in this module have defined type extensions. Alias and script properties have been defined.
500+
501+
```powershell
502+
PS C:\Scripts\PSProjectStatus> Get-PSProjectstatus | Get-Member -MemberType Properties,PropertySet
503+
504+
TypeName: PSProject
505+
506+
Name MemberType Definition
507+
---- ---------- ----------
508+
Username AliasProperty Username = UpdateUser
509+
Version AliasProperty Version = ProjectVersion
510+
Comment Property string Comment {get;set;}
511+
Computername Property string Computername {get;set;}
512+
GitBranch Property string GitBranch {get;set;}
513+
LastUpdate Property datetime LastUpdate {get;set;}
514+
Name Property string Name {get;set;}
515+
Path Property string Path {get;set;}
516+
ProjectVersion Property version ProjectVersion {get;set;}
517+
RemoteRepository Property PSProjectRemote[] RemoteRepository {get;set;}
518+
Status Property PSProjectStatus Status {get;set;}
519+
Tags Property string[] Tags {get;set;}
520+
Tasks Property string[] Tasks {get;set;}
521+
UpdateUser Property string UpdateUser {get;set;}
522+
Info PropertySet Info {Name, Status, Version, GitBranch, Tasks, Tags, Comment}
523+
versionInfo PropertySet versionInfo {Name, Status, Version, GitBranch, LastUpdate}
524+
Age ScriptProperty System.Object Age {get=(Get-Date) - $this.lastUpdate;}
525+
```
526+
527+
The property sets make it easier to display a group of related properties.
528+
529+
```powershell
530+
PS C:\Scripts\PSProjectStatus> Get-PSProjectstatus | Select Info
531+
532+
Name : PSProjectStatus
533+
Status : Updating
534+
Version : 0.12.0
535+
GitBranch : 0.12.0
536+
Tasks : {Create TUI-based management tools, Consider extending schema for a structured Task item [Issue 10],
537+
Pester tests, Update README…}
538+
Tags : {json}
539+
Comment : none
540+
```
541+
542+
### Formatting
543+
544+
The module uses custom and default formatting for projects and tasks. The default format is a table. There are examples you can see in several screenshots above. You can use also `Format-List`.
545+
546+
```powershell
547+
PS C:\Scripts\PSProjectStatus> Get-PSProjectStatus | Format-List
548+
549+
Project: PSProjectStatus [C:\Scripts\PSProjectStatus]
550+
551+
Version : 0.12.0
552+
Status : Updating
553+
Tasks : {Create TUI-based management tools, Consider extending schema for a structured Task item [Issue 10],
554+
Pester tests, Update README…}
555+
Tags : {json}
556+
GitBranch : 0.12.0
557+
LastUpdate : 12/28/2023 5:51:42 PM
558+
Age : 00:14:21.9538891
559+
```
560+
561+
There is also a named view you can use.
562+
563+
```powershell
564+
PS C:\Scripts\PSProjectStatus> Get-PSProjectStatus | Format-List -View info
565+
566+
Project: PSProjectStatus [C:\Scripts\PSProjectStatus]
567+
568+
Status : Updating
569+
Tasks : {Create TUI-based management tools, Consider extending schema for a structured Task item [Issue 10], Pester
570+
tests, Update README…}
571+
Tags : {json}
572+
Comment : none
573+
Age : 00.00:16:04
574+
```
575+
576+
### Verbose, Warning, and Debug
577+
578+
The commands in this module use localized string data to display verbose, warning, and debug messages. The module uses a private helper function to display verbose messaging. Each module command can be identified with a different ANSI color scheme.
579+
580+
![Sample verbose output](images/verbose-output.png)
581+
582+
You must use a PowerShell console that supports ANSI escape sequences. The PowerShell ISE __does not__ support this feature.
583+
425584
## Editor Integration
426585

427586
If you import this module into your PowerShell editor, either Visual Studio Code or the PowerShell ISE, the module will add an update function called `Update-PSProjectStatus`. You can run the command from the integrated terminal or use the appropriate shortcut (see below). The command will the status based on user input, update the `LastUpdate` time to the current date and time, update the project version from the module manifest (if found), and update the git branch if found.
@@ -463,9 +622,9 @@ These are a few things I'm considering or have been suggested.
463622
+ Additional properties
464623
+ priority
465624
+ project type
466-
+ tags
467-
+ Extend the module to integrate into a SQLite database file. Although I would want this to work cross-platform.
468625
+ Editor integration to manage project tasks.
469626
+ A WPF or TUI form to display the project status and make it easier to edit tasks.
470627

471628
If you have any suggestions on how to extend this module or tips to others on how you are using it, please feel free to use the [Discussions](https://github.com/jdhitsolutions/PSProjectStatus/discussions) section of this module's GitHub repository.
629+
630+
> Project icon by [Icons8](https://icons8.com)

0 commit comments

Comments
 (0)