Skip to content
Permalink
Browse files

fix to work with PS5 .1 as well as 7

  • Loading branch information
SQLDBAWithABeard committed Jan 9, 2020
1 parent 1a26079 commit 0d09c3c158ced473b2973b0d4e4f219b9475d177
@@ -23,6 +23,7 @@ https://dbachecks.readthedocs.io/en/latest/functions/Save-DbcRequiredModules/
#>
function Save-DbcRequiredModules {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (
[Parameter (Mandatory)]
@@ -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
@@ -15,6 +15,8 @@ function Assert-JobHistoryRowsDisabled {
}

function Assert-JobHistoryRows {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (
$AgentServer,
$minimumJobHistoryRows
@@ -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"
}
@@ -62,6 +62,8 @@ function Assert-DatabaseDuplicateIndex {
}

function Assert-DatabaseExists {
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
Param (
[string]$Instance,
[string]$ExpectedDB
@@ -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"
}
@@ -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
}
}
@@ -66,6 +66,7 @@
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidTrailingWhiteSpace", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseDeclaredVarsMoreThanAssignments", "")]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
[CmdletBinding()]
param (

0 comments on commit 0d09c3c

Please sign in to comment.
You can’t perform that action at this time.