Skip to content

Commit ba7ceb7

Browse files
committed
Merge branch 'dev'
2 parents c1319f2 + 75fd460 commit ba7ceb7

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/ScheduledTaskManagement/Public/Setup-ScheduledTask.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -22,31 +22,31 @@ function Setup-ScheduledTask {
2222
try {
2323
# Import definitions as an array of hashtable definitions
2424
$DefinitionsCollection = New-Object System.Collections.ArrayList
25-
if ($PSBoundParameters['DefinitionFile']) {
26-
$DefinitionFileCollection = Get-Item $PSBoundParameters['DefinitionFile']
27-
}elseif ($PSBoundParameters['DefinitionDirectory']) {
28-
$DefinitionFileCollection = if ($PSBoundParameters['AsJson']) {
29-
Get-ChildItem $PSBoundParameters['DefinitionDirectory'] -File | ? { $_.Extension -eq '.json' }
25+
if ($DefinitionFile) {
26+
$DefinitionFileCollection = Get-Item $DefinitionFile
27+
}elseif ($DefinitionDirectory) {
28+
$DefinitionFileCollection = if ($AsJson) {
29+
Get-ChildItem $DefinitionDirectory -File | ? { $_.Extension -eq '.json' }
3030
}else {
31-
Get-ChildItem $PSBoundParameters['DefinitionDirectory'] -File | ? { $_.Extension -eq '.ps1' }
31+
Get-ChildItem $DefinitionDirectory -File | ? { $_.Extension -eq '.ps1' }
3232
}
3333
}
34-
if (!$PSBoundParameters['DefinitionObject']) {
34+
if (!$DefinitionObject) {
3535
if (!$DefinitionFileCollection) {
3636
"No definitions could be found from the specified definition files or directories." | Write-Error
3737
return
3838
}
3939
}
40-
if (!$PSBoundParameters['DefinitionObject']) {
40+
if (!$DefinitionObject) {
4141
$DefinitionCollectionRaw = $DefinitionFileCollection | % {
42-
if ($PSBoundParameters['AsJson']) {
43-
Get-Content -Path $_.FullName | ConvertFrom-Json
42+
if ($AsJson) {
43+
Get-Content $_.FullName | ConvertFrom-Json
4444
}else {
4545
. $_.FullName
4646
}
4747
}
48-
}elseif ($PSBoundParameters['DefinitionObject']) {
49-
$DefinitionCollectionRaw = $PSBoundParameters['DefinitionObject']
48+
}elseif ($DefinitionObject) {
49+
$DefinitionCollectionRaw = $DefinitionObject
5050
}
5151
$DefinitionCollectionRaw | % {
5252
$definitionHashtable = if ($_.GetType() -ne [hashtable]) { $_ | ConvertTo-Hashtable } else { $_ }

src/ScheduledTaskManagement/ScheduledTaskManagement.psm1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ $script:MODULE['PRIVATE_DIR'] = Join-Path $script:MODULE['BASE_DIR'] 'Private'
1212
$script:MODULE['HELPERS_DIR'] = Join-Path $script:MODULE['BASE_DIR'] 'helpers' # Module helpers
1313

1414
# Load vendor, Public, Private, classes, helpers
15-
Get-ChildItem -Path "$($script:MODULE['PUBLIC_DIR'])\*.ps1" | % { . $_.FullName }
16-
Get-ChildItem -Path "$($script:MODULE['PRIVATE_DIR'])\*.ps1" | % { . $_.FullName }
17-
Get-ChildItem -Path "$($script:MODULE['HELPERS_DIR'])\*.ps1" | % { . $_.FullName }
15+
Get-ChildItem "$($script:MODULE['PUBLIC_DIR'])\*.ps1" | % { . $_.FullName }
16+
Get-ChildItem "$($script:MODULE['PRIVATE_DIR'])\*.ps1" | % { . $_.FullName }
17+
Get-ChildItem "$($script:MODULE['HELPERS_DIR'])\*.ps1" | % { . $_.FullName }
1818

1919
# Export Public functions
2020
Export-ModuleMember -Function (Get-ChildItem "$($script:MODULE['PUBLIC_DIR'])\*.ps1" | Select-Object -ExpandProperty BaseName)

0 commit comments

Comments
 (0)