Уточнить настройки PSScriptAnalyzer
This commit is contained in:
@@ -40,8 +40,20 @@ jobs:
|
|||||||
"windows/*.psm1",
|
"windows/*.psm1",
|
||||||
"windows/*.psd1"
|
"windows/*.psd1"
|
||||||
)
|
)
|
||||||
|
$settings = @{
|
||||||
|
Rules = @{
|
||||||
|
PSAvoidUsingEmptyCatchBlock = @{ Enable = $false }
|
||||||
|
PSAvoidUsingWriteHost = @{ Enable = $false }
|
||||||
|
PSUseApprovedVerbs = @{ Enable = $false }
|
||||||
|
PSUseBOMForUnicodeEncodedFile = @{ Enable = $false }
|
||||||
|
PSUseDeclaredVarsMoreThanAssignments = @{ Enable = $false }
|
||||||
|
PSUseShouldProcessForStateChangingFunctions = @{ Enable = $false }
|
||||||
|
PSUseSingularNouns = @{ Enable = $false }
|
||||||
|
PSUseToExportFieldsInManifest = @{ Enable = $false }
|
||||||
|
}
|
||||||
|
}
|
||||||
$issues = $targets | ForEach-Object {
|
$issues = $targets | ForEach-Object {
|
||||||
Invoke-ScriptAnalyzer -Path $_ -Recurse -Severity Error,Warning
|
Invoke-ScriptAnalyzer -Path $_ -Recurse -Severity Error,Warning -Settings $settings
|
||||||
}
|
}
|
||||||
if ($issues) {
|
if ($issues) {
|
||||||
$issues | Format-Table -AutoSize
|
$issues | Format-Table -AutoSize
|
||||||
|
|||||||
@@ -158,12 +158,12 @@ function Get-HostFromUrl {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$uri = [Uri]$Url
|
$uri = [Uri]$Url
|
||||||
$host = $uri.Host.ToLowerInvariant()
|
$uriHost = $uri.Host.ToLowerInvariant()
|
||||||
if ($host.StartsWith('www.')) {
|
if ($uriHost.StartsWith('www.')) {
|
||||||
return $host.Substring(4)
|
return $uriHost.Substring(4)
|
||||||
}
|
}
|
||||||
|
|
||||||
return $host
|
return $uriHost
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
return $null
|
return $null
|
||||||
|
|||||||
@@ -158,12 +158,12 @@ function Get-HostFromUrl {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$uri = [Uri]$Url
|
$uri = [Uri]$Url
|
||||||
$host = $uri.Host.ToLowerInvariant()
|
$uriHost = $uri.Host.ToLowerInvariant()
|
||||||
if ($host.StartsWith('www.')) {
|
if ($uriHost.StartsWith('www.')) {
|
||||||
return $host.Substring(4)
|
return $uriHost.Substring(4)
|
||||||
}
|
}
|
||||||
|
|
||||||
return $host
|
return $uriHost
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
return $null
|
return $null
|
||||||
|
|||||||
Reference in New Issue
Block a user