Skip to content

Commit 4d5ec56

Browse files
committed
quick mods for improving compliance with psscriptanalyzer
1 parent fe35cf3 commit 4d5ec56

8 files changed

+7
-5
lines changed

Functions/Get-JSMRequiredJob.ps1

-1.16 KB
Binary file not shown.

Functions/Invoke-JSMProcessingLoop.ps1

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function Invoke-JSMProcessingLoop
3434
{
3535
$message = 'Invoke-JobProcessingLoop: Get-RequiredJob'
3636
Write-Verbose -Message $message
37-
$RequiredJobs = Get-JSMRequiredJob -Settings $Settings -JobDefinitions $jobDefinitions -ErrorAction Stop
37+
$RequiredJobs = Get-JSMRequiredJob -Settings $Settings -JobDefinition $jobDefinitions -ErrorAction Stop
3838
$RequiredJobsLookup = @{}
3939
foreach ($j in $RequiredJobs) {$RequiredJobsLookup.$($j.name) = $true}
4040
Write-Verbose -Message $message
-1.1 KB
Binary file not shown.

Functions/Test-JSMJobCondition.ps1

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ function Test-JSMJobCondition
1010
$ConditionValuesObject
1111
,
1212
[Parameter(Mandatory)]
13-
[ValidateSet($true,$false)]
1413
[bool]$TestFor
1514
)
1615
switch ($TestFor)

Issues.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
- [x] when restarting a job processing loop some start/end times are lost on jobs. Need to detangle requiredjobs and definedjobs in invoke-jsmprocessingloop
44
- [ ] make RequiredJobs a hashtable just like the other *jobs variables
5-
- [x] fix the notification settings
5+
- [x] fix the notification settings
6+
- [ ] make set-jsmperiodicreportsetting leave current values in place and only set what is specified each time it is used

JobSetManager.psd1

+1
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ FunctionsToExport = @(
100100
'Test-JSMStopWatchPeriod'
101101
'New-JSMProcessingLoopStatusEntry'
102102
'Get-JSMProcessingLoopStatusEntry'
103+
)
103104

104105
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
105106
#CmdletsToExport = '*'

ScriptAnalyzerSettings.psd1

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
# for a few rules you wish to "exclude". Note: if a rule is in both IncludeRules
2020
# and ExcludeRules, the rule will be excluded.
2121
#ExcludeRules = @('PSAvoidUsingWriteHost')
22+
ExcludeRules = @('PSUseShouldProcessForStateChangingFunctions')
2223

2324
# You can use the following entry to supply parameters to rules that take parameters.
2425
# For instance, the PSAvoidUsingCmdletAliases rule takes a whitelist for aliases you

Tests/New-JSMProcessingLoopStatusEntry.Tests.ps1

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
66
[object[]]$params = (Get-ChildItem "function:\$CommandName").Parameters.Keys
77
$knownParameters = 'JobName','Message','Status','PassThru'
88
$paramCount = $knownParameters.Count
9-
It "Should contain our specific parameters" {
9+
It "Should contain specific parameters" {
1010
( (Compare-Object -ReferenceObject $knownParameters -DifferenceObject $params -IncludeEqual | Where-Object SideIndicator -eq "==").Count ) | Should Be $paramCount
1111
}
1212
It "Should only contain $paramCount parameters" {
@@ -30,7 +30,7 @@ Describe "$commandname Integration Tests" -Tags "IntegrationTests" {
3030
$Entry.status | Should Be $true
3131
}
3232

33-
It "Increments the EntryID" {
33+
It "Increments and returns the EntryID" {
3434
$NextEntry = New-JSMProcessingLoopStatusEntry -JobName 'Job1' -Message 'Doing Something with or to Job1' -Status $false -PassThru
3535
$Entry.EntryID -lt $NextEntry.EntryID | Should Be $true
3636
}

0 commit comments

Comments
 (0)