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

Commit

Permalink
Added module scope to myTaskDefaultCategories
Browse files Browse the repository at this point in the history
  • Loading branch information
shaneis authored Nov 27, 2018
1 parent 9baa2e2 commit 115080c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions MyTasksFunctions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Function New-MyTask {
where-object {$_ -match "\w+"} | foreach-object {$_.Trim()}
}
else {
$arrSet = $myTaskDefaultCategories
$arrSet = $script:myTaskDefaultCategories
}
$ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet)

Expand Down Expand Up @@ -336,7 +336,7 @@ Function Set-MyTask {
$arrSet = Get-Content -Path $global:myTaskCategory -Encoding Unicode | where-object {$_ -match "\w+"} | foreach-object {$_.Trim()}
}
else {
$arrSet = $myTaskDefaultCategories
$arrSet = $script:myTaskDefaultCategories
}
$ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet)

Expand Down Expand Up @@ -583,7 +583,7 @@ Function Get-MyTask {
$arrSet = Get-Content -Path $global:myTaskCategory | where-object {$_ -match "\w+"} | foreach-object {$_.Trim()}
}
else {
$arrSet = $myTaskDefaultCategories
$arrSet = $script:myTaskDefaultCategories
}

$ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet)
Expand Down Expand Up @@ -714,7 +714,7 @@ Function Show-MyTask {
where-object {$_ -match "\w+"} | foreach-object {$_.Trim()}
}
else {
$arrSet = $myTaskDefaultCategories
$arrSet = $script:myTaskDefaultCategories
}
$ValidateSetAttribute = New-Object System.Management.Automation.ValidateSetAttribute($arrSet)

Expand Down Expand Up @@ -961,7 +961,7 @@ Function Get-MyTaskCategory {
else {
#Display the defaults
Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Retrieving module default categories"
$myTaskDefaultCategories
$script:myTaskDefaultCategories
}
} #process
End {
Expand Down Expand Up @@ -991,7 +991,7 @@ Function Add-MyTaskCategory {
#create it
if (-Not (Test-Path -Path $global:myTaskCategory)) {
Write-Verbose "[$((Get-Date).TimeofDay) BEGIN ] Creating new user category file $global:myTaskCategory"
Set-Content -Value "" -Path $global:myTaskCategory -Encoding Unicode
Set-Content -Value $script:myTaskDefaultCategories -Path $global:myTaskCategory -Encoding Unicode
}
#get current contents
$current = Get-Content -Path $global:myTaskCategory -Encoding Unicode | where-object {$_ -match "\w+"}
Expand Down

0 comments on commit 115080c

Please sign in to comment.