File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed
Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -3,17 +3,15 @@ $testPath = Resolve-Path -Path "$PSScriptRoot/tests/PSScriptAnalyzer" | Select-O
33$path = [string ]::IsNullOrEmpty($env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path ) ? ' .' : $env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_Path
44$codePath = Resolve-Path - Path $path | Select-Object - ExpandProperty Path
55
6- # Try to resolve the settings file path, but allow it to be null if not found
7- [string ]$settingsFilePath = ' '
8- if (-not [string ]::IsNullOrEmpty($env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath )) {
9- try {
10- Write-Host " Looking for settings file under $ ( $pwd.Path ) "
11- $settingsFilePath = (Resolve-Path - Path $env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath - ErrorAction Stop).Path
12- Write-Information " Using settings file: $settingsFilePath "
13- } catch {
14- Write-Warning " Settings file not found at path: $ ( $env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath ) . Using default settings."
15- }
6+ Write-Host " Looking for settings file under $ ( $pwd.Path ) "
7+ $tmpSettingsFilePath = Join-Path - Path $pwd.Path - ChildPath $env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath
8+ $settingsFileExists = Test-Path - Path $tmpSettingsFilePath
9+ if ($settingsFileExists ) {
10+ $settingsFilePath = $tmpSettingsFilePath
11+ } else {
12+ $settingsFilePath = ' '
1613}
14+ Write-Warning " Settings file not found at path: $ ( $env: PSMODULE_INVOKE_SCRIPTANALYZER_INPUT_SettingsFilePath ) . Using default settings."
1715
1816[pscustomobject ]@ {
1917 CodePath = $codePath
You can’t perform that action at this time.
0 commit comments