-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Composite: Centralized SkipRule functionality (#83)
* moved to dot source file * renamed test * consolidated tests into composite.tests * added test module * updated readme * Updated common blocks * fixed SuppressMessageAttribute * fixed helper name * changed PSBoundParameters path * fixed spelling
- Loading branch information
Showing
16 changed files
with
250 additions
and
418 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. | ||
|
||
$rules = Get-RuleClassData -StigData $StigData -Name SqlScriptQueryRule | ||
|
||
foreach ($instance in $ServerInstance) | ||
{ | ||
if ($null -ne $Database) | ||
{ | ||
foreach ($db in $Database) | ||
{ | ||
foreach ( $rule in $rules ) | ||
{ | ||
SqlScriptQuery "$(Get-ResourceTitle -Rule $rule)$instance" | ||
{ | ||
ServerInstance = $Instance | ||
GetQuery = $rule.GetScript | ||
TestQuery = $rule.TestScript | ||
SetQuery = $rule.SetScript | ||
Variable = $db | ||
} | ||
} | ||
} | ||
} | ||
else | ||
{ | ||
foreach ($rule in $rules) | ||
{ | ||
SqlScriptQuery "$(Get-ResourceTitle -Rule $rule)$instance" | ||
{ | ||
ServerInstance = $instance | ||
GetQuery = $rule.GetScript | ||
TestQuery = $rule.TestScript | ||
SetQuery = $rule.SetScript | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.