Skip to content

Commit 3e225dd

Browse files
author
Kapil Borle
committed
Update README
* Remove announcement and reviewable section from README * Rename sections * Update installation section to use buildCoreClr.ps1 script * Move tests in installation section
1 parent 3f01fd0 commit 3e225dd

File tree

1 file changed

+72
-54
lines changed

1 file changed

+72
-54
lines changed

README.md

+72-54
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,36 @@
1-
[![Join the chat at https://gitter.im/PowerShell/PSScriptAnalyzer](https://badges.gitter.im/PowerShell/PSScriptAnalyzer.svg)](https://gitter.im/PowerShell/PSScriptAnalyzer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1+
[![Join the chat at https://gitter.im/PowerShell/PSScriptAnalyzer](https://badges.gitter.im/PowerShell/PSScriptAnalyzer.svg)](https://gitter.im/PowerShell/PSScriptAnalyzer?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
22

3-
Announcements
4-
=============
5-
6-
###### [PSScriptAnalyzer 1.7.0 also supports PowerShell on Ubuntu 14.04!](https://www.powershellgallery.com/packages/PSScriptAnalyzer)
7-
8-
##### Builds
93
|Master | Development |
104
|:------:|:------:|:-------:|:-------:|
115
[![Build status](https://ci.appveyor.com/api/projects/status/h5mot3vqtvxw5d7l/branch/master?svg=true)](https://ci.appveyor.com/project/PowerShell/psscriptanalyzer/branch/master)|[![Build status](https://ci.appveyor.com/api/projects/status/h5mot3vqtvxw5d7l/branch/development?svg=true)](https://ci.appveyor.com/project/PowerShell/psscriptanalyzer/branch/development) |
126

13-
#### Code Review Dashboard on [reviewable.io](https://reviewable.io/reviews/PowerShell/PSScriptAnalyzer#-)
7+
Table of Contents
8+
=================
9+
10+
<!-- toc -->
11+
12+
- [Introduction](#introduction)
13+
- [Usage](#usage)
14+
- [Installation](#installation)
15+
+ [From PowerShell Gallery](#from-powershell-gallery)
16+
- [Requirements](#requirements)
17+
* [Windows](#windows)
18+
* [Linux (*Tested only on Ubuntu 14.04*)](#linux-tested-only-on-ubuntu-1404)
19+
+ [From Source](#from-source)
20+
- [Requirements](#requirements-1)
21+
- [Steps](#steps)
22+
- [Tests](#tests)
23+
- [Suppressing Rules](#suppressing-rules)
24+
- [Settings Support in ScriptAnalyzer](#settings-support-in-scriptanalyzer)
25+
* [Explicit](#explicit)
26+
* [Implicit](#implicit)
27+
- [ScriptAnalyzer as a .NET library](#scriptanalyzer-as-a-net-library)
28+
- [Violation Correction](#violation-correction)
29+
- [Project Management Dashboard](#project-management-dashboard)
30+
- [Contributing to ScriptAnalyzer](#contributing-to-scriptanalyzer)
31+
- [Code of Conduct](#code-of-conduct)
32+
33+
<!-- tocstop -->
1434

1535
Introduction
1636
============
@@ -21,37 +41,35 @@ code defects and suggests possible solutions for improvements.
2141
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,
2242
usage of Invoke-Expression etc. Additional functionalities such as exclude/include specific rules are also supported.
2343

24-
PSScriptAnalyzer Cmdlets
44+
Usage
2545
======================
2646
``` PowerShell
2747
Get-ScriptAnalyzerRule [-CustomizedRulePath <string[]>] [-Name <string[]>] [<CommonParameters>] [-Severity <string[]>]
2848
2949
Invoke-ScriptAnalyzer [-Path] <string> [-CustomizedRulePath <string[]>] [-ExcludeRule <string[]>] [-IncludeRule <string[]>] [-Severity <string[]>] [-Recurse] [<CommonParameters>]
3050
```
3151

32-
Requirements
52+
Installation
3353
============
3454

35-
### Windows
55+
### From PowerShell Gallery
56+
```powershell
57+
Install-Module -Name PSScriptAnalyzer
58+
```
59+
60+
#### Requirements
61+
62+
##### Windows
3663
- Windows PowerShell 3.0 or greater
3764
- PowerShell Core
3865

39-
### Linux (*Tested only on Ubuntu 14.04*)
66+
##### Linux (*Tested only on Ubuntu 14.04*)
4067
- PowerShell Core
4168

42-
Get PSScriptAnalyzer
43-
============
44-
45-
### PowerShell Gallery
69+
### From Source
4670

47-
```powershell
48-
Install-Module -Name PSScriptAnalyzer
49-
```
50-
51-
### Source
52-
53-
#### Dependencies
54-
* Visual Studio 2015
71+
#### Requirements
72+
* .Net Core
5573
* [PlatyPS 0.5.0 or greater](https://github.com/PowerShell/platyPS)
5674

5775
#### Steps
@@ -62,17 +80,25 @@ Install-Module -Name PSScriptAnalyzer
6280
git clone https://github.com/PowerShell/PSScriptAnalyzer
6381
```
6482
* Navigate to the source directory
65-
```powershell
66-
cd path/to/PSScriptAnalyzer
67-
```
83+
```powershell
84+
cd path/to/PSScriptAnalyzer
85+
```
6886
* Build for your platform
6987
* Windows PowerShell version 5.0 and greater
7088
```powershell
71-
.\build.ps1 -Configuration "Release" -BuildSolution -BuildDocs
89+
.\buildCoreClr.ps1 -Framework net451 -Configuration Release -Build
7290
```
7391
* Windows PowerShell version 3.0 and 4.0
7492
```powershell
75-
.\build.ps1 -Configuration "PSV3 Release" -BuildSolution -BuildDocs
93+
.\buildCoreClr.ps1 -Framework net451 -Configuration PSV3Release -Build
94+
```
95+
* PowerShell Core
96+
```powershell
97+
.\buildCoreClr.ps1 -Framework netstandard1.6 -Configuration Release -Build
98+
```
99+
* Build documenatation
100+
```powershell
101+
.\build.ps1 -BuildDocs
76102
```
77103
* Import the module
78104
```powershell
@@ -81,6 +107,23 @@ Import-Module /path/to/PSScriptAnalyzer/out/PSScriptAnalyzer
81107

82108
To confirm installation: run `Get-ScriptAnalyzerRule` in the PowerShell console to obtain the built-in rules
83109

110+
#### Tests
111+
Pester-based ScriptAnalyzer Tests are located in `path/to/PSScriptAnalyzer/Tests` folder.
112+
113+
* Ensure Pester is installed on the machine
114+
* Copy `path/to/PSScriptAnalyzer/out/PSScriptAnalyzer` to a folder in `PSModulePath`
115+
* Go the Tests folder in your local repository
116+
* Run Engine Tests:
117+
``` PowerShell
118+
cd /path/to/PSScriptAnalyzer/Tests/Engine
119+
Invoke-Pester
120+
```
121+
* Run Tests for Built-in rules:
122+
``` PowerShell
123+
cd /path/to/PSScriptAnalyzer/Tests/Rules
124+
Invoke-Pester
125+
```
126+
84127
Suppressing Rules
85128
=================
86129

@@ -290,31 +333,6 @@ The main motivation behind having `SuggestedCorrections` is to enable quick-fix
290333
* MissingModuleManifestField.cs
291334
* UseToExportFieldsInManifest.cs
292335

293-
Building the Code
294-
=================
295-
296-
Use Visual Studio to build "PSScriptAnalyzer.sln". Use ~/PSScriptAnalyzer/ folder to load PSScriptAnalyzer.psd1
297-
298-
**Note: If there are any build errors, please refer to Requirements section and make sure all dependencies are properly installed**
299-
300-
301-
Running Tests
302-
=============
303-
304-
Pester-based ScriptAnalyzer Tests are located in `<branch>/PSScriptAnalyzer/Tests` folder.
305-
306-
1. Ensure Pester is installed on the machine
307-
2. Go the Tests folder in your local repository
308-
3. Run Engine Tests:
309-
``` PowerShell
310-
.\InvokeScriptAnalyzer.tests.ps1
311-
```
312-
4. Run Tests for Built-in rules:
313-
``` PowerShell
314-
.\*.ps1 (Example - .\ AvoidConvertToSecureStringWithPlainText.ps1)
315-
```
316-
You can also run all tests under \Engine or \Rules by calling Invoke-Pester in the Engine/Rules directory.
317-
318336
Project Management Dashboard
319337
==============================
320338
You can track issues, pull requests, backlog items here:

0 commit comments

Comments
 (0)