You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to use a PSScriptAnalyzerSettings.psd1 file in a repository folder, not necessarily at my workspace root. If I include a file in my module folder and try and invoke it, it doesn't take a relative path only the full path to the file. Of course I could be using this incorrectly so feel free to point me in the right direction ;)
Steps to reproduce
I:\MICROSOFT\PowerShell\Modules\BlumeModule>Invoke-ScriptAnalyzer-Path .\private -Setting .\PSScriptAnalyzerSettings.psd1
WARNING: Cannot parse settings. Will abort the invocation.
Expected behavior
I:\MICROSOFT\PowerShell\Modules\BlumeModule> Invoke-ScriptAnalyzer -Path .\private -Setting I:\MICROSOFT\PowerShell\Modules\BlumeModule\PSScriptAnalyzerSettings.psd1
RuleName Severity ScriptName Line Message
-------- -------- ---------- ---- -------
PSUseApprovedVerbs Warning perform-up 1 The cmdlet 'Perform-Update' uses an unapproved verb.
date.ps1
Actual behavior
WARNING: Cannot parse settings. Will abort the invocation.
@Benny1007 Thanks for reporting this. For the moment please use a full path but it should not be too difficult to make it also support relative paths.
In a script you can easily achieve this as follows: $fullPath = Join-Path $PSScriptRoot 'relative\path'
On the command line you can do : Join-Path (Get-Location) 'relative\path'
And if your relative path includes navigation like e.g. ..\ then you might also need to wrap the resulting path in Resolve-Path
I would like to use a PSScriptAnalyzerSettings.psd1 file in a repository folder, not necessarily at my workspace root. If I include a file in my module folder and try and invoke it, it doesn't take a relative path only the full path to the file. Of course I could be using this incorrectly so feel free to point me in the right direction ;)
Steps to reproduce
Expected behavior
Actual behavior
Environment data
The text was updated successfully, but these errors were encountered: