@@ -123,25 +123,33 @@ Note: the PSScriptAnalyzer Chocolatey package is provided and supported by the c
123
123
* Building
124
124
125
125
You can either build using the `Visual Studio` solution `PSScriptAnalyzer.sln` or build using `PowerShell` specifically for your platform as follows:
126
- * Windows PowerShell version 5.0 and greater
126
+ * The default build is for PowerShell Core
127
127
```powershell
128
- .\buildCoreClr.ps1 -Framework net451 -Configuration Release -Build
128
+ .\build.ps1
129
+ ```
130
+ * Windows PowerShell version 5.0
131
+ ```powershell
132
+ .\build.ps1 -Framework full -AnalyzerVersion PSV5 -Configuration Release
129
133
```
130
134
* Windows PowerShell version 4.0
131
135
```powershell
132
- .\buildCoreClr .ps1 -Framework net451 -Configuration PSV4Release -Build
136
+ .\build .ps1 -Framework full -AnalyzerVersion PSV4 -Configuration Release
133
137
```
134
138
* Windows PowerShell version 3.0
135
139
```powershell
136
- .\buildCoreClr .ps1 -Framework net451 -Configuration PSV3Release -Build
140
+ .\build .ps1 -Framework full -AnalyzerVersion PSV3 -Configuration Release
137
141
```
138
142
* PowerShell Core
139
143
```powershell
140
- .\buildCoreClr.ps1 -Framework netstandard2.0 -Configuration Release -Build
144
+ .\buildCoreClr.ps1 -Framework core -Configuration Release -Build
145
+ ```
146
+ * Build documentation
147
+ ```powershell
148
+ .\build.ps1 -Documentation
141
149
```
142
- * Build documenatation
150
+ * Build all versions (PowerShell v3, v4, v5, and Core) and documentation
143
151
```powershell
144
- .\build.ps1 -BuildDocs
152
+ .\build.ps1 -All
145
153
```
146
154
* Import the module
147
155
```powershell
@@ -157,12 +165,25 @@ For adding/removing resource strings in the `*.resx` files, it is recommended to
157
165
#### Tests
158
166
Pester-based ScriptAnalyzer Tests are located in ` path/to/PSScriptAnalyzer/Tests ` folder.
159
167
160
- * Ensure [ Pester 4.3.1] ( https://www.powershellgallery.com/packages/Pester/4.3.1 ) is installed
161
- * Copy ` path/to/PSScriptAnalyzer/out/PSScriptAnalyzer ` to a folder in ` PSModulePath `
168
+ * Ensure [ Pester 4.3.1] ( https://www.powershellgallery.com/packages/Pester/4.3.1 ) or higher is installed
169
+ * Ensure that the documentation has been built ( ` ./build.ps1 -Documentation ` )
162
170
* In the root folder of your local repository, run:
163
171
``` PowerShell
164
- $testScripts = ".\Tests\Engine",".\Tests\Rules",".\Tests\Documentation"
165
- Invoke-Pester -Script $testScripts
172
+ ./build -Test
173
+ ```
174
+
175
+ To retrieve the results of the run, you can use the tools which are part of the build module (` build.psm1 ` )
176
+
177
+ ``` powershell
178
+ Import-Module ./build.psm1
179
+ Get-TestResults
180
+ ```
181
+
182
+ To retrieve only the errors, you can use the following:
183
+
184
+ ``` powershell
185
+ Import-Module ./build.psm1
186
+ Get-TestFailures
166
187
```
167
188
168
189
[ Back to ToC] ( #table-of-contents )
0 commit comments