Skip to content

Commit

Permalink
Merge pull request devops-collective-inc#6 from nocentino/main
Browse files Browse the repository at this point in the history
Added Anthony's stuff
  • Loading branch information
psjamesp committed May 3, 2023
2 parents 13b7efd + b19958d commit db435f4
Show file tree
Hide file tree
Showing 7 changed files with 517 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file added anthony-nocentino/.DS_Store
Binary file not shown.
Binary file not shown.
Binary file not shown.
479 changes: 479 additions & 0 deletions anthony-nocentino/favorite-dbatools-cmdlets/demo.ps1

Large diffs are not rendered by default.

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Param(
[Parameter(
Mandatory = $true,
Position = 0,
HelpMessage = 'Specify a servername',
ValueFromPipeline = $true
)]
[pscredential] $SqlCredential,
[ValidateNotNullOrEmpty()]
[string[]] $SqlInstance
)
foreach ($pSqlInstance in $SqlInstance) {
Describe "Test for Instance Level Settings" {
Context "$pSqlInstance`: Memory Configuration" {
$Memory = (Test-DbaMaxMemory -SqlInstance $pSqlInstance -SqlCredential $SqlCredential)
$RecommendedValue = ($Memory.RecommendedValue)
$MaxValue = ($Memory.MaxValue)
It "Checking the Max Memory setting for the instance should be $RecommendedValue" {
$MaxValue | Should -Be $RecommendedValue
}
}

Context "$pSqlInstance`: MaxDOP Configuration" {
$dop = (Test-DbaMaxDop -SqlInstance $pSqlInstance -SqlCredential $SqlCredential)
$DopInstance = ($dop | Where-Object { $_.Database -eq 'n/a' })
$DopDatabase = ($dop | Where-Object { $_.Database -ne 'n/a' })

It "$pSqlInstance`: Checking if Instance MAXDOP exceeds the number of cores in a NUMA node" {
$DopInstance.CurrentInstanceMaxDop | Should -BeLessOrEqual $($DopInstance.RecommendedMaxDop) -Because "we do not want to span a NUMA Node. Resource: Instance. Suggested value: $($DopInstance.RecommendedMaxDop)"
}
@($DopDatabase.Database).foreach{
It "$pSqlInstance`: Checking if database: $($DopDatabase.Database) MAXDOP exceeds the number of cores in a NUMA node" {
$DopDatabase.DatabaseMaxDop | Should -BeLessOrEqual $($DopDatabase.RecommendedMaxDop) -Because "We do not want to span a NUMA Node. Resource: $($DopDatabase.Database). Suggested value: $($DopDatabase.RecommendedMaxDop)"
}
}
}
}
}

0 comments on commit db435f4

Please sign in to comment.