Skip to content

Commit 1ecdd56

Browse files
author
Kapil Borle
committed
Update README
1 parent d45547c commit 1ecdd56

File tree

1 file changed

+43
-13
lines changed

1 file changed

+43
-13
lines changed

README.md

Lines changed: 43 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,54 @@ Invoke-ScriptAnalyzer [-Path] <string> [-CustomizedRulePath <string[]>] [-Exclud
4949
Requirements
5050
============
5151

52-
WS2012R2 / Windows 8.1 / Windows OS running a **minimum of PowerShell v3.0**
52+
### Windows
53+
- Windows PowerShell 3.0 or greater
54+
- PowerShell Core
5355

54-
A Windows OS with PowerShell v5.0 [Windows Management Framework 5.0 Preview](http://go.microsoft.com/fwlink/?LinkId=398175) is also supported
56+
### Linux (*Tested only on Ubuntu 14.04*)
57+
- PowerShell Core
5558

56-
57-
Installation
59+
Get PSScriptAnalyzer
5860
============
5961

60-
1. Build the Code using Visual Studio [solution part of the repo] and navigate to the binplace location [``~/ProjectRoot/PSScriptAnalyzer``]
62+
### PowerShell Gallery
6163

62-
2. In PowerShell Console:
6364
```powershell
64-
Import-Module PSScriptAnalyzer
65+
Install-Module -Name PSScriptAnalyzer
6566
```
66-
If you have previous version of PSScriptAnalyzer installed on your machine, you may need to override old binaries by copying content of [``~/ProjectRoot/PSScriptAnalyzer``] to PSModulePath.
6767

68-
To confirm installation: run ```Get-ScriptAnalyzerRule``` in the PowerShell console to obtain the built-in rules
68+
### Source
69+
70+
#### Dependencies
71+
* Visual Studio 2015
72+
* [PlatyPS 0.5.0 or greater](https://github.com/PowerShell/platyPS)
6973

74+
#### Steps
75+
* Obtain the source
76+
- Download the latest source code from the release page (https://github.com/PowerShell/PSScriptAnalyzer/releases) OR
77+
- Clone the repository (needs git)
78+
```powershell
79+
git clone https://github.com/PowerShell/PSScriptAnalyzer
80+
```
81+
* Navigate to the source directory
82+
```powershell
83+
cd path/to/PSScriptAnalyzer
84+
```
85+
* Build for your platform
86+
* Windows PowerShell version 5.0 and greater
87+
```powershell
88+
.\build.ps1 -Configuration "Release" -BuildSolution -BuildDocs
89+
```
90+
* Windows PowerShell version 3.0 and 4.0
91+
```powershell
92+
.\build.ps1 -Configuration "PSV3 Release" -BuildSolution -BuildDocs
93+
```
94+
* Import the module
95+
```powershell
96+
Import-Module /path/to/PSScriptAnalyzer/out/PSScriptAnalyzer
97+
```
98+
99+
To confirm installation: run ```Get-ScriptAnalyzerRule``` in the PowerShell console to obtain the built-in rules
70100

71101
Suppressing Rules
72102
=================
@@ -146,7 +176,7 @@ To match all functions/variables/parameters/objects, use `*` as the value of the
146176
Param(
147177
)
148178

149-
**Note**: Rule suppression is currently supported only for built-in rules.
179+
**Note**: Rule suppression is currently supported only for built-in rules.
150180

151181
Settings Support in ScriptAnalyzer
152182
========================================
@@ -227,7 +257,7 @@ PS> Get-Content C:\tmp\test.ps1
227257
gci C:\
228258
```
229259

230-
Invoking PSScriptAnalyzer on the file gives the following output.
260+
Invoking PSScriptAnalyzer on the file gives the following output.
231261

232262
```powershell
233263
PS>$diagnosticRecord = Invoke-ScriptAnalyzer -Path C:\tmp\test.p1
@@ -254,9 +284,9 @@ class DiagnosticRecord
254284

255285
The `*LineNumber` and `*ColumnNumber` properties give the region of the script that can be replaced by the contents of `Text` property, i.e., replace gci with Get-ChildItem.
256286

257-
The main motivation behind having `SuggestedCorrections` is to enable quick-fix like scenarios in editors like VSCode, Sublime, etc. At present, we provide valid `SuggestedCorrection` only for the following rules, while gradually adding this feature to more rules.
287+
The main motivation behind having `SuggestedCorrections` is to enable quick-fix like scenarios in editors like VSCode, Sublime, etc. At present, we provide valid `SuggestedCorrection` only for the following rules, while gradually adding this feature to more rules.
258288

259-
* AvoidAlias.cs
289+
* AvoidAlias.cs
260290
* AvoidUsingPlainTextForPassword.cs
261291
* MisleadingBacktick.cs
262292
* MissingModuleManifestField.cs

0 commit comments

Comments
 (0)