Skip to content

Commit 511ee68

Browse files
author
Kapil Borle
authored
Merge pull request #704 from PowerShell/kapilmb/fix-docs
Update documentation
2 parents db46934 + 1091789 commit 511ee68

File tree

5 files changed

+21
-12
lines changed

5 files changed

+21
-12
lines changed

README.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Table of Contents
3232

3333
<!-- tocstop -->
3434

35-
Introduction
35+
Introduction [&uarr;](#table-of-contents)
3636
============
3737
PSScriptAnalyzer is a static code checker for Windows PowerShell modules and scripts. PSScriptAnalyzer checks the quality of Windows PowerShell code by running a set of rules.
3838
The rules are based on PowerShell best practices identified by PowerShell Team and the community. It generates DiagnosticResults (errors and warnings) to inform users about potential
@@ -41,15 +41,16 @@ code defects and suggests possible solutions for improvements.
4141
PSScriptAnalyzer is shipped with a collection of built-in rules that checks various aspects of PowerShell code such as presence of uninitialized variables, usage of PSCredential Type,
4242
usage of Invoke-Expression etc. Additional functionalities such as exclude/include specific rules are also supported.
4343

44-
Usage
44+
45+
Usage [&uarr;](#table-of-contents)
4546
======================
4647
``` PowerShell
4748
Get-ScriptAnalyzerRule [-CustomizedRulePath <string[]>] [-Name <string[]>] [<CommonParameters>] [-Severity <string[]>]
4849
4950
Invoke-ScriptAnalyzer [-Path] <string> [-CustomizedRulePath <string[]>] [-ExcludeRule <string[]>] [-IncludeRule <string[]>] [-Severity <string[]>] [-Recurse] [<CommonParameters>]
5051
```
5152

52-
Installation
53+
Installation [&uarr;](#table-of-contents)
5354
============
5455

5556
### From PowerShell Gallery
@@ -75,7 +76,7 @@ Exit
7576
### From Source
7677

7778
#### Requirements
78-
* .Net Core
79+
* [.NET Core 1.0 SDK Preview 2](https://github.com/dotnet/core/blob/master/release-notes/download-archives/1.0-preview2-download.md)
7980
* [PlatyPS 0.5.0 or greater](https://github.com/PowerShell/platyPS)
8081

8182
#### Steps
@@ -89,6 +90,10 @@ Exit
8990
```powershell
9091
cd path/to/PSScriptAnalyzer
9192
```
93+
* Restore packages
94+
```powershell
95+
dotnet restore
96+
```
9297
* Build for your platform
9398
* Windows PowerShell version 5.0 and greater
9499
```powershell
@@ -130,7 +135,7 @@ cd /path/to/PSScriptAnalyzer/Tests/Rules
130135
Invoke-Pester
131136
```
132137

133-
Suppressing Rules
138+
Suppressing Rules [&uarr;](#table-of-contents)
134139
=================
135140

136141
You can suppress a rule by decorating a script/function or script/function parameter with .NET's [SuppressMessageAttribute](https://msdn.microsoft.com/en-us/library/system.diagnostics.codeanalysis.suppressmessageattribute.aspx).
@@ -215,7 +220,7 @@ Param()
215220

216221
**Note**: Rule suppression is currently supported only for built-in rules.
217222

218-
Settings Support in ScriptAnalyzer
223+
Settings Support in ScriptAnalyzer [&uarr;](#table-of-contents)
219224
========================================
220225
Settings that describe ScriptAnalyzer rules to include/exclude based on `Severity` can be created and supplied to
221226
`Invoke-ScriptAnalyzer` using the `Setting` parameter. This enables a user to create a custom configuration for a specific environment. We support the following modes for specifying the settings file.
@@ -264,7 +269,7 @@ Invoke-ScriptAnalyzer -Path "C:\path\to\project" -Recurse
264269

265270
Note that providing settings explicitly takes higher precedence over this implicit mode. Sample settings files are provided [here](https://github.com/PowerShell/PSScriptAnalyzer/tree/master/Engine/Settings).
266271

267-
ScriptAnalyzer as a .NET library
272+
ScriptAnalyzer as a .NET library [&uarr;](#table-of-contents)
268273
================================
269274

270275
ScriptAnalyzer engine and functionality can now be directly consumed as a library.
@@ -288,7 +293,7 @@ public System.Collections.Generic.IEnumerable<DiagnosticRecord> AnalyzePath(stri
288293
public System.Collections.Generic.IEnumerable<IRule> GetRule(string[] moduleNames, string[] ruleNames)
289294
```
290295

291-
Violation Correction
296+
Violation Correction [&uarr;](#table-of-contents)
292297
====================
293298
Most violations can be fixed by replacing the violation causing content with the correct alternative.
294299

@@ -334,7 +339,7 @@ The main motivation behind having `SuggestedCorrections` is to enable quick-fix
334339
* MissingModuleManifestField.cs
335340
* UseToExportFieldsInManifest.cs
336341

337-
Project Management Dashboard
342+
Project Management Dashboard [&uarr;](#table-of-contents)
338343
==============================
339344
You can track issues, pull requests, backlog items here:
340345

@@ -348,7 +353,7 @@ Throughput Graph
348353

349354
[![Throughput Graph](https://graphs.waffle.io/powershell/psscriptanalyzer/throughput.svg)](https://waffle.io/powershell/psscriptanalyzer/metrics)
350355

351-
Contributing to ScriptAnalyzer
356+
Contributing to ScriptAnalyzer [&uarr;](#table-of-contents)
352357
==============================
353358
You are welcome to contribute to this project. There are many ways to contribute:
354359

@@ -369,6 +374,6 @@ You might also read these two blog posts about contributing code: [Open Source C
369374

370375
Before submitting a feature or substantial code contribution, please discuss it with the Windows PowerShell team via [Issues](https://github.com/PowerShell/PSScriptAnalyzer/issues), and ensure it follows the product roadmap. Note that all code submissions will be rigorously reviewed by the Windows PowerShell Team. Only those that meet a high bar for both quality and roadmap fit will be merged into the source.
371376

372-
Code of Conduct
377+
Code of Conduct [&uarr;](#table-of-contents)
373378
===============
374379
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

RuleDocumentation/PlaceCloseBrace.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Close brace placement should follow a consistent style. It should be on a new li
1313
Enable = $true
1414
NoEmptyLineBefore = $false
1515
}
16+
}
1617
```
1718

1819
### Parameters

RuleDocumentation/PlaceOpenBrace.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Open brace placement should follow a consistent style. It can either follow KR s
1414
OnSameLine = $true
1515
NewLineAfter = $true
1616
}
17+
}
1718
```
1819

1920
### Parameters

RuleDocumentation/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,5 @@
4949
|[UseCompatibleCmdlets](./UseCompatibleCmdlets.md) | Warning|
5050
|[PlaceOpenBrace](./PlaceOpenBrace.md) | Warning|
5151
|[PlaceCloseBrace](./PlaceCloseBrace.md) | Warning|
52-
|[UseConsistentIndentation](./UseConsistentIndentation.md) | Warning|
52+
|[UseConsistentIndentation](./UseConsistentIndentation.md) | Warning|
53+
|[UseConsistentWhitespace](./UseConsistentWhitespace.md) | Warning|

RuleDocumentation/UseConsistentIndentation.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Indentation should be consistent throughout the source file.
1313
Enable = $true
1414
NoEmptyLineBefore = $false
1515
}
16+
}
1617
```
1718

1819
### Parameters

0 commit comments

Comments
 (0)