SublimeLinter-contrib-Powershell
SublimeLinter plugin for PowerShell
Details
Installs
- Total 6K
- Win 5K
- Mac 731
- Linux 568
Sep 17 | Sep 16 | Sep 15 | Sep 14 | Sep 13 | Sep 12 | Sep 11 | Sep 10 | Sep 9 | Sep 8 | Sep 7 | Sep 6 | Sep 5 | Sep 4 | Sep 3 | Sep 2 | Sep 1 | Aug 31 | Aug 30 | Aug 29 | Aug 28 | Aug 27 | Aug 26 | Aug 25 | Aug 24 | Aug 23 | Aug 22 | Aug 21 | Aug 20 | Aug 19 | Aug 18 | Aug 17 | Aug 16 | Aug 15 | Aug 14 | Aug 13 | Aug 12 | Aug 11 | Aug 10 | Aug 9 | Aug 8 | Aug 7 | Aug 6 | Aug 5 | Aug 4 | Aug 3 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 2 | 1 | 1 | 0 | 1 | 3 | 0 | 2 | 4 | 3 | 2 | 1 | 1 | 2 | 2 | 2 | 1 | 1 | 1 | 2 | 5 | 2 | 0 | 0 | 3 | 0 | 3 | 2 | 1 | 0 | 1 | 2 | 2 | 1 | 0 | 2 | 0 | 0 | 2 | 0 | 0 | 1 | 2 | 0 | 1 | 1 |
Mac | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 2 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 1 | 2 | 1 | 0 | 0 |
Linux | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
SublimeLinter-contrib-powershell
This linter plugin for SublimeLinter provides an interface to PSScriptAnalyzer. It will be used with files that have the PowerShell
syntax.
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.
Installation
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.
Settings
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:PSScriptAnalyzerSettingsPath
exists in your powershell environment and is populated with the full path to a valid settings file, those settings will be used.If the variable
$GlobalPSScriptAnalyzerSettingsPath
exists 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
$GlobalPSScriptAnalyzerSettingsPath
variable 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.
Type Powershell: Fix warnings
in the command palette to try it out.
SublimeLinter settings
- SublimeLinter settings: http://sublimelinter.readthedocs.org/en/latest/settings.html
- Linter settings: http://sublimelinter.readthedocs.org/en/latest/linter_settings.html