24 lines
652 B
PowerShell
24 lines
652 B
PowerShell
function Invoke-CustomRuleAnalyzers {
|
|
<#
|
|
.SYNOPSIS
|
|
Execute analyzer rules against a specific path.
|
|
#>
|
|
[CmdletBinding()]
|
|
Param(
|
|
[Parameter(Mandatory = $true)]
|
|
[string]$TargetPath,
|
|
[Parameter()]
|
|
[string]$CustomRulePath,
|
|
[switch]$Recurse
|
|
)
|
|
|
|
if($null -eq $CustomRulePath)
|
|
{
|
|
$root = Split-Path -Path $PSScriptRoot -Parent
|
|
Write-Host "root: $root"
|
|
$CustomRulePath = Join-Path -Path $root -ChildPath "Alkami.PowerShell.PSScriptAnalyzerRules.psm1"
|
|
}
|
|
|
|
Invoke-ScriptAnalyzer -Path $TargetPath -Recurse:$Recurse -IncludeDefaultRules -CustomRulePath $CustomRulePath
|
|
|
|
} |