SublimeLinter plugin for PowerShell
- Total 5K
- Win 4K
- Mac 602
- Linux 464
|Mar 21||Mar 20||Mar 19||Mar 18||Mar 17||Mar 16||Mar 15||Mar 14||Mar 13||Mar 12||Mar 11||Mar 10||Mar 9||Mar 8||Mar 7||Mar 6||Mar 5||Mar 4||Mar 3||Mar 2||Mar 1||Feb 28||Feb 27||Feb 26||Feb 25||Feb 24||Feb 23||Feb 22||Feb 21||Feb 20||Feb 19||Feb 18||Feb 17||Feb 16||Feb 15||Feb 14||Feb 13||Feb 12||Feb 11||Feb 10||Feb 9||Feb 8||Feb 7||Feb 6||Feb 5||Feb 4|
This linter plugin for SublimeLinter provides an interface to PSScriptAnalyzer. It will be used with files that have the
This linter works on Windows PowerShell 3.0 or greater and PowerShell Core 6.2 or greater on Windows/Linux/macOS.
You can check your powershell version with
$PSVersionTable.PSVersion from a powershell prompt.
SublimeLinter must be installed in order to use this plugin. Please use Package Control to install the linter plugin.
Before installing this plugin, you must ensure that PSScriptAnalyzer is installed on your system and available on powershell startup.
PSScriptAnalyzer can be installed with
Install-Module -Name PSScriptAnalyzer from a powershell prompt, which automatically makes the module available on powershell startup.
The simplest way to change the ScriptAnalyzer settings is from a settings file.
An example settings file with commented options is located in this plugins root folder. The provided example settings file checks for compatibility with powershell 3.0 and excludes the check for trailing spaces.
The linter will decide which settings to use in the following order:
If a valid PSScriptAnalyzerSettings.psd1 file exists in your project folder, those settings will have precedence over all other settings. This enables you to use different settings for different projects.
If the environment variable
Env:PSScriptAnalyzerSettingsPathexists in your powershell environment and is populated with the full path to a valid settings file, those settings will be used.
If the variable
$GlobalPSScriptAnalyzerSettingsPathexists in your powershell environment and is populated with the full path to a valid settings file, those settings will be used. This enables you to use global custom settings. For persistency, set this variable in your powershell profile.
If no settings file is found in your project folder and the
$GlobalPSScriptAnalyzerSettingsPathvariable is not set, default settings of PSScriptAnalyzer will be used. (all default rules enabled and no compatibility checks)
PSScriptAnalyzer have the ability to automatically fix certain warnings. For example expanding aliases. Even though I believe this functionality is fairly tested, always make sure to back your files before using it.
Powershell: Fix warnings in the command palette to try it out.
- SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html
- Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html