Skip to content
This repository has been archived by the owner on Sep 16, 2022. It is now read-only.

Commit

Permalink
see changelog for v1.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jdhitsolutions committed Jan 7, 2019
1 parent dd960ff commit f46435f
Show file tree
Hide file tree
Showing 13 changed files with 708 additions and 234 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) 2016-2018 JDH Information Technology Solutions, Inc.
Copyright (c) 2016-2019 JDH Information Technology Solutions, Inc.


Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
94 changes: 85 additions & 9 deletions MyTasks.format.ps1xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
<!--
Any changes made to this file may be overwritten in future module updates
Expand Down Expand Up @@ -79,17 +79,17 @@ Any changes made to this file may be overwritten in future module updates
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</View>
<View>
<Name>Category</Name>
<Name>Category</Name>
<ViewSelectedBy>
<TypeName>MyTask</TypeName>
</ViewSelectedBy>
<GroupBy>
<PropertyName>Category</PropertyName>
</GroupBy>
<TableControl>
<TableHeaders>
<TableHeaders>
<TableColumnHeader>
<Label>Name</Label>
<Width>28</Width>
Expand Down Expand Up @@ -119,7 +119,7 @@ Any changes made to this file may be overwritten in future module updates
<TableRowEntries>
<TableRowEntry>
<Wrap/>
<TableColumnItems>
<TableColumnItems>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
Expand All @@ -131,7 +131,7 @@ Any changes made to this file may be overwritten in future module updates
<FormatString>{0:d}</FormatString>
</TableColumnItem>
<TableColumnItem>
<PropertyName>OverDue</PropertyName>
<PropertyName>OverDue</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Progress</PropertyName>
Expand All @@ -141,7 +141,7 @@ Any changes made to this file may be overwritten in future module updates
</TableRowEntries>
</TableControl>
</View>
<View>
<View>
<Name>default</Name>
<ViewSelectedBy>
<TypeName>MyTask</TypeName>
Expand Down Expand Up @@ -174,7 +174,7 @@ Any changes made to this file may be overwritten in future module updates
<ListItem>
<PropertyName>TaskModified</PropertyName>
</ListItem>
</ListItems>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
Expand Down Expand Up @@ -221,10 +221,86 @@ Any changes made to this file may be overwritten in future module updates
<ListItem>
<PropertyName>TaskID</PropertyName>
</ListItem>
</ListItems>
</ListItems>
</ListEntry>
</ListEntries>
</ListControl>
</View>
<View>
<Name>default</Name>
<ViewSelectedBy>
<TypeName>MyTaskArchive</TypeName>
</ViewSelectedBy>
<TableControl>
<TableHeaders>
<TableColumnHeader>
<Label>ID</Label>
<Width>3</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Name</Label>
<Width>25</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Description</Label>
<Width>20</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Created</Label>
<Width>10</Width>
<Alignment>Right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>DueDate</Label>
<Width>10</Width>
<Alignment>Right</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Completed</Label>
<Width>10</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
<TableColumnHeader>
<Label>Category</Label>
<Width>12</Width>
<Alignment>Left</Alignment>
</TableColumnHeader>
</TableHeaders>
<TableRowEntries>
<TableRowEntry>
<Wrap/>
<TableColumnItems>
<TableColumnItem>
<PropertyName>ID</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Name</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Description</PropertyName>
</TableColumnItem>
<TableColumnItem>
<PropertyName>TaskCreated</PropertyName>
<FormatString>{0:d}</FormatString>
</TableColumnItem>
<TableColumnItem>
<PropertyName>DueDate</PropertyName>
<FormatString>{0:d}</FormatString>
</TableColumnItem>
<TableColumnItem>
<PropertyName>TaskModified</PropertyName>
<FormatString>{0:d}</FormatString>
</TableColumnItem>
<TableColumnItem>
<PropertyName>Category</PropertyName>
</TableColumnItem>
</TableColumnItems>
</TableRowEntry>
</TableRowEntries>
</TableControl>
</View>
</ViewDefinitions>
</Configuration>
6 changes: 3 additions & 3 deletions MyTasks.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
RootModule = 'MyTasks.psm1'

# Version number of this module.
ModuleVersion = '1.8.2'
ModuleVersion = '1.9.0'

# ID used to uniquely identify this module
GUID = '6a5db6e0-9669-4178-a176-54b4931aa4e2'
Expand All @@ -20,7 +20,7 @@ Author = 'Jeff Hicks'
CompanyName = 'JDH Information Technology Solutions, Inc.'

# Copyright statement for this module
Copyright = '(c) 2016-2018 JDH Information Technology Solutions, Inc. All rights reserved.'
Copyright = '(c) 2016-2019 JDH Information Technology Solutions, Inc. All rights reserved.'

# Description of the functionality provided by this module
Description = 'A tool set for managing tasks or to-do projects in PowerShell. Task data is stored in XML and managed through a PowerShell class.'
Expand Down Expand Up @@ -65,7 +65,7 @@ FormatsToProcess = "MyTasks.format.ps1xml"
FunctionsToExport = @("New-MyTask","Set-MyTask","Remove-MyTask","Get-MyTask",
"Show-MyTask","Complete-MyTask","Get-MyTaskCategory","Add-MyTaskCategory",
"Remove-MyTaskCategory","Backup-MyTaskFile","Save-MyTask","Enable-EmailReminder",
"Disable-EmailReminder","Get-EmailReminder","Set-MyTaskPath")
"Disable-EmailReminder","Get-EmailReminder","Set-MyTaskPath","Get-MyTaskArchive")

# Cmdlets to export from this module
# CmdletsToExport = '*'
Expand Down
19 changes: 11 additions & 8 deletions MyTasks.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if ($isLinux) {
$global:mytaskhome = $home
}
else {
$global:mytaskhome = "$home\Documents"
$global:mytaskhome = "$home\Documents"
}

#path to the category file
Expand All @@ -31,15 +31,18 @@ Register-ArgumentCompleter -CommandName $cmd -ParameterName Name -ScriptBlock {
param($commandName, $parameterName, $wordToComplete, $commandAst, $fakeBoundParameter)

[xml]$In = Get-Content -Path $MyTaskPath -Encoding UTF8

foreach ($obj in $in.Objects.object) {
$tasks = foreach ($obj in $in.Objects.object) {
$obj.Property | ForEach-Object -Begin {$propHash = [ordered]@{}} -Process {
$propHash.Add($_.name, $_.'#text')
}
$propHash |
foreach-object {
} -end {$prophash}
}
($tasks).where( {$_.name -like "$wordToComplete*"}) | foreach-object {
# completion text,listitem text,result type,Tooltip
[System.Management.Automation.CompletionResult]::new($_.Name, $_.Name, 'ParameterValue', "Due: $($_.DueDate) Completed: $($_.completed)")
[System.Management.Automation.CompletionResult]::new("'$($_.Name)'", "'$($_.Name)'", 'ParameterValue', "Due: $($_.DueDate -as [datetime]) Completed: $($_.completed)")
}
}
}

#define default properties for myTaskArchive

Update-TypeData -TypeName myTaskArchive -MemberType AliasProperty -MemberName Completed -Value TaskModified -force
Update-TypeData -TypeName myTaskArchive -MemberType AliasProperty -MemberName Creeated -Value TaskCreated -force
Loading

0 comments on commit f46435f

Please sign in to comment.