Skip to content

Commit

Permalink
fix to work with PS5 .1 as well as 7
Browse files Browse the repository at this point in the history
  • Loading branch information
SQLDBAWithABeard committed Jan 9, 2020
1 parent 1a26079 commit 0d09c3c
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions functions/Save-DbcRequiredModules.ps1
Expand Up @@ -23,6 +23,7 @@ https://dbachecks.readthedocs.io/en/latest/functions/Save-DbcRequiredModules/
#>
function Save-DbcRequiredModules {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (
[Parameter (Mandatory)]
Expand Down
1 change: 1 addition & 0 deletions functions/Update-DbcRequiredModules.ps1
Expand Up @@ -20,6 +20,7 @@ https://dbachecks.readthedocs.io/en/latest/functions/Update-DbcRequiredModules/
#>
function Update-DbcRequiredModules {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding(SupportsShouldProcess = $true, ConfirmImpact = "Medium")]
param (
[switch]$EnableException
Expand Down
4 changes: 4 additions & 0 deletions internal/assertions/Agent.Assertions.ps1
Expand Up @@ -15,6 +15,8 @@ function Assert-JobHistoryRowsDisabled {
}

function Assert-JobHistoryRows {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (
$AgentServer,
$minimumJobHistoryRows
Expand All @@ -32,6 +34,8 @@ function Assert-JobHistoryRowsPerJob {


function Assert-LongRunningJobs {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
Param($runningjob,$runningjobpercentage)
[math]::Round($runningjob.Diff/$runningjob.AvgSec * 100) | Should -BeLessThan $runningjobpercentage -Because "The current running job $($runningjob.JobName) has been running for $($runningjob.Diff) seconds longer than the average run time. This is more than the $runningjobpercentage % specified as the maximum"
}
Expand Down
2 changes: 2 additions & 0 deletions internal/assertions/Database.Assertions.ps1
Expand Up @@ -62,6 +62,8 @@ function Assert-DatabaseDuplicateIndex {
}

function Assert-DatabaseExists {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
Param (
[string]$Instance,
[string]$ExpectedDB
Expand Down
4 changes: 4 additions & 0 deletions internal/assertions/Instance.Assertions.ps1
Expand Up @@ -551,10 +551,14 @@ function Assert-EngineStartTypeCluster {
}

function Assert-OleAutomationProcedures {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
Param($AllInstanceInfo)
$AllInstanceInfo.OleAutomationProceduresDisabled.ConfiguredValue | Should -Be 0 -Because "We expect the OLE Automation Procedures to be disabled"
}
function Assert-ScanForStartupProcedures {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param ($AllInstanceInfo)
$AllInstanceInfo.ScanForStartupProceduresDisabled.ConfiguredValue | Should -Be 0 -Because "We expected the scan for startup procedures to be disabled"
}
Expand Down
2 changes: 1 addition & 1 deletion internal/functions/Get-CheckInformation.ps1
Expand Up @@ -42,7 +42,7 @@ function Get-CheckInformation {
@($Check).ForEach{
if($GroupChecks -contains $psitem){
## BUT - This falls flat when you use a tag for a number of Checks that is not a group (like CIS) in that case all you get in $CheckInfo is CIS and not the relevant unique tags
@(Get-DbcCheck -Pattern $psitem).ForEach{
@(Get-DbcCheck -Tag $psitem).ForEach{
$CheckInfo += $psitem.UniqueTag
}
}
Expand Down
Expand Up @@ -66,6 +66,7 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidTrailingWhiteSpace", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (

Expand Down

0 comments on commit 0d09c3c

Please sign in to comment.