-
Notifications
You must be signed in to change notification settings - Fork 265
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix bugs in Build-Documentation script. (#460)
- Loading branch information
Showing
12 changed files
with
169 additions
and
108 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
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,41 @@ | ||
function Convert-AllowedEffectsToCsvString { | ||
param ( | ||
$DefaultEffect, | ||
[bool] $IsEffectParameterized, | ||
$EffectAllowedValues, | ||
$EffectAllowedOverrides, | ||
[string] $InCellSeparator1, | ||
[string] $InCellSeparator2 | ||
) | ||
|
||
$allowedList = @() | ||
$prefix = "default" | ||
if ($IsEffectParameterized -and $EffectAllowedValues.Count -gt 1) { | ||
$allowedList = $EffectAllowedValues | ||
$prefix = "parameter" | ||
} | ||
elseif ($EffectAllowedOverrides.Count -gt 1) { | ||
$allowedList = $EffectAllowedOverrides | ||
$prefix = "override" | ||
} | ||
elseif ($null -ne $DefaultEffect) { | ||
$prefix = "default" | ||
$allowedList = @( $DefaultEffect ) | ||
} | ||
else { | ||
$prefix = "none" | ||
$allowedList = @() | ||
return "$(prefix)$($InCellSeparator1)No effect allowed$($InCellSeparator2)Error" | ||
} | ||
|
||
$effectArray = @() | ||
foreach ($effectValue in @( "Modify", "Append", "DenyAction", "Deny", "Audit", "Manual", "DeployIfNotExists", "AuditIfNotExists", "Disabled" )) { | ||
# sorted logicaly | ||
if ($allowedList -contains $effectValue) { | ||
$effectArray += $effectValue | ||
} | ||
} | ||
$effectAllowedText = "$($prefix)$($InCellSeparator1)$($effectArray -join $InCellSeparator2)" | ||
|
||
return $effectAllowedText | ||
} |
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,22 @@ | ||
function Convert-EffectToCsvString { | ||
param ( | ||
# Parameter help description | ||
[Parameter(Position = 0, Mandatory = $true, ValueFromPipeline = $true, HelpMessage = "The effect to convert to a CSV string")] | ||
[string] $Effect | ||
) | ||
|
||
# Convert the effect to a CSV string to fix mixed case sensitivity | ||
$effectValueText = switch ($Effect) { | ||
"Modify" { "Modify" } | ||
"Append" { "Append" } | ||
"DenyAction" { "DenyAction" } | ||
"Deny" { "Deny" } | ||
"Audit" { "Audit" } | ||
"Manual" { "Manual" } | ||
"DeployIfNotExists" { "DeployIfNotExists" } | ||
"AuditIfNotExists" { "AuditIfNotExists" } | ||
"Disabled" { "Disabled" } | ||
default { "Error" } | ||
} | ||
return $effectValueText | ||
} |
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,22 @@ | ||
function Convert-EffectToMarkdownString { | ||
param ( | ||
[string] $Effect, | ||
[array] $AllowedValues | ||
) | ||
|
||
[string] $text = "" | ||
if ($null -ne $Effect) { | ||
if ($AllowedValues.Count -eq 1) { | ||
$text = "***$Effect***" | ||
} | ||
else { | ||
$text = "**$Effect**" | ||
} | ||
foreach ($allowed in $AllowedValues) { | ||
if ($allowed -cne $Effect) { | ||
$text += "<br/>*$allowed*" | ||
} | ||
} | ||
} | ||
return $text | ||
} |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.