Skip to content

Commit 463c82f

Browse files
authored
Merge branch 'main' into copilot/fix-2609
2 parents f7f3232 + d5b72ea commit 463c82f

File tree

93 files changed

+3505
-736
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+3505
-736
lines changed

.devcontainer/devcontainer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// README at: https://github.com/devcontainers/templates/tree/main/src/dotnet
33
{
44
"name": "PSRule Developer",
5-
"image": "mcr.microsoft.com/devcontainers/dotnet:1-8.0-noble",
5+
"image": "mcr.microsoft.com/devcontainers/dotnet:8.0-noble",
66
"customizations": {
77
"vscode": {
88
"settings": {
@@ -14,6 +14,7 @@
1414
}
1515
},
1616
"extensions": [
17+
"ms-dotnettools.vscode-dotnet-runtime",
1718
"ms-dotnettools.csdevkit",
1819
"ms-vscode.powershell",
1920
"github.vscode-pull-request-github",
@@ -34,7 +35,7 @@
3435
"version": "latest"
3536
}
3637
},
37-
"onCreateCommand": "dotnet tool install --global PowerShell --version 7.4.6 && sudo chown -R vscode:vscode /usr/bin/pwsh && sudo apt-get update -y && sudo apt-get upgrade -y && dotnet restore && pip install -r requirements-docs.txt && ln /usr/bin/pwsh /home/vscode/.dotnet/tools/pwsh --force",
38+
"onCreateCommand": "sudo ./dotnet-install.sh --install-dir /usr/lib/dotnet && sudo dotnet workload update && dotnet tool install --global PowerShell --version 7.4.10 && sudo chown -R vscode:vscode /usr/bin/pwsh && sudo apt-get update -y && sudo apt-get upgrade -y && dotnet restore && pip install -r requirements-docs.txt && ln /usr/bin/pwsh /home/vscode/.dotnet/tools/pwsh --force",
3839
"updateContentCommand": "/usr/bin/pwsh -f .devcontainer/container-build.ps1",
3940
"postStartCommand": "/usr/bin/pwsh -f .devcontainer/container-start.ps1"
4041
}

.github/workflows/build.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
fetch-depth: 0
4141

4242
- name: Setup .NET
43-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
43+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
4444
with:
4545
global-json-file: global.json
4646

@@ -127,7 +127,7 @@ jobs:
127127
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
128128

129129
- name: Setup .NET
130-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
130+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
131131
with:
132132
global-json-file: global.json
133133

@@ -173,12 +173,12 @@ jobs:
173173
fetch-depth: 0
174174

175175
- name: Setup node.js
176-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
176+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
177177
with:
178178
node-version: 20
179179

180180
- name: Setup .NET
181-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
181+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
182182
with:
183183
global-json-file: global.json
184184

@@ -224,12 +224,12 @@ jobs:
224224
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
225225

226226
- name: Setup node.js
227-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
227+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
228228
with:
229229
node-version: 20
230230

231231
- name: Setup .NET
232-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
232+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
233233
with:
234234
global-json-file: global.json
235235

@@ -264,7 +264,7 @@ jobs:
264264
fetch-depth: 0
265265

266266
- name: Setup Python
267-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
267+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
268268
with:
269269
python-version: '3.11'
270270
architecture: 'x64'
@@ -292,7 +292,7 @@ jobs:
292292
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
293293

294294
- name: Setup .NET
295-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
295+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
296296
with:
297297
global-json-file: global.json
298298

@@ -346,7 +346,7 @@ jobs:
346346
option: ps-rule-ci.yaml
347347

348348
- name: Upload results to security tab
349-
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
349+
uses: github/codeql-action/upload-sarif@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5
350350
if: always()
351351
with:
352352
sarif_file: reports/ps-rule-results.sarif
@@ -377,7 +377,7 @@ jobs:
377377
directory-to-scan: .
378378

379379
- name: Upload results to security tab
380-
uses: github/codeql-action/upload-sarif@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
380+
uses: github/codeql-action/upload-sarif@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5
381381
if: always()
382382
with:
383383
sarif_file: devskim-results.sarif
@@ -403,15 +403,15 @@ jobs:
403403
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
404404

405405
- name: Initialize CodeQL
406-
uses: github/codeql-action/init@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
406+
uses: github/codeql-action/init@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5
407407
with:
408408
languages: 'csharp'
409409

410410
- name: Autobuild
411-
uses: github/codeql-action/autobuild@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
411+
uses: github/codeql-action/autobuild@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5
412412

413413
- name: Perform CodeQL Analysis
414-
uses: github/codeql-action/analyze@3c3833e0f8c1c83d449a7478aa59c036a9165498 # v3.29.5
414+
uses: github/codeql-action/analyze@f1f6e5f6af878fb37288ce1c627459e94dbf7d01 # v3.29.5
415415
id: codeql-analyze
416416

417417
- name: Upload results

.github/workflows/copilot-setup-steps.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
fetch-depth: 0
3030

3131
- name: Setup .NET
32-
uses: actions/setup-dotnet@67a3573c9a986a3f9c594539f4ab511d57bb3ce9 # v4.3.1
32+
uses: actions/setup-dotnet@d4c94342e560b34958eacfc5d055d21461ed1c5d # v5.0.0
3333
with:
3434
global-json-file: global.json
3535

3636
- name: Setup node.js
37-
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
37+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3838
with:
3939
node-version: 20
4040

.github/workflows/docs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
3333
3434
- name: Setup Python
35-
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
35+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3636
with:
3737
python-version: '3.11'
3838
architecture: 'x64'

.github/workflows/stale.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
permissions:
2222
issues: write
2323
steps:
24-
- uses: actions/stale@5bef64f19d7facfb25b37b414482c7164d639639 # v9.1.0
24+
- uses: actions/stale@3a9db7e6a41a89f618792c92c0e97cc736e1b13f # v10.0.0
2525
with:
2626
stale-issue-message: >
2727
This issue has been automatically marked as stale because it has not had

docs/changelog.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ What's changed since pre-release v3.0.0-B0453:
3434
- Added support and by default error if rules or input is not found during a run by @BernieWhite.
3535
[#1778](https://github.com/microsoft/PSRule/issues/1778)
3636
- Added options for `Execution.NoMatchingRules`, `Execution.NoValidInput`, and `Execution.NoValidSources`.
37+
- Added support for customizing CSV output columns by @BernieWhite.
38+
[#1165](https://github.com/microsoft/PSRule/issues/1165)
39+
- The `Output.CsvDetailedColumns` option can be used to customize the columns included in the CSV output format.
40+
- General improvements:
41+
- Reload language server when options change by @BernieWhite.
42+
[#2842](https://github.com/microsoft/PSRule/issues/2842)
3743
- Engineering:
3844
- **Important change**: Remove legacy log scopes by @BernieWhite.
3945
[#2891](https://github.com/microsoft/PSRule/issues/2891)

docs/concepts/PSRule/en-US/about_PSRule_Options.md

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ The following workspace options are available for use:
4949
- [Input.TargetType](#inputtargettype)
5050
- [Output.As](#outputas)
5151
- [Output.Banner](#outputbanner)
52+
- [Output.CsvDetailedColumns](#outputcsvdetailedcolumns)
5253
- [Output.Culture](#outputculture)
5354
- [Output.Encoding](#outputencoding)
5455
- [Output.Footer](#outputfooter)
@@ -2488,6 +2489,71 @@ variables:
24882489
value: en-AU;en-US
24892490
```
24902491

2492+
### Output.CsvDetailedColumns
2493+
2494+
<!-- module:version 3.0.0 -->
2495+
2496+
Configures which columns are included when using CSV detailed output format.
2497+
This option allows you to customize the columns included in CSV output, reducing file size and focusing on relevant information.
2498+
2499+
When this option is not specified, all default columns are included:
2500+
`RuleName`, `TargetName`, `TargetType`, `Outcome`, `OutcomeReason`, `Synopsis`, `Recommendation`.
2501+
2502+
When this option is specified, only the configured columns are included.
2503+
The column order in the output matches the order specified in the configuration.
2504+
2505+
Supported column types:
2506+
2507+
- **Standard properties**: `RuleName`, `TargetName`, `TargetType`, `Outcome`, `OutcomeReason`, `Synopsis`, `Recommendation`
2508+
- **Custom properties**: Properties under `Info.Annotations`, `Tag`, and `Field`
2509+
2510+
Invalid column names result in empty values and do not cause errors.
2511+
2512+
This option can be specified using:
2513+
2514+
```powershell
2515+
# PowerShell: Using the OutputCsvDetailedColumns parameter
2516+
$option = New-PSRuleOption -OutputCsvDetailedColumns 'RuleName', 'TargetName', 'Outcome', 'Synopsis';
2517+
```
2518+
2519+
```powershell
2520+
# PowerShell: Using the Output.CsvDetailedColumns hashtable key
2521+
$option = New-PSRuleOption -Option @{ 'Output.CsvDetailedColumns' = 'RuleName', 'TargetName', 'Outcome', 'Synopsis' };
2522+
```
2523+
2524+
```powershell
2525+
# PowerShell: Using the OutputCsvDetailedColumns parameter to set YAML
2526+
Set-PSRuleOption -OutputCsvDetailedColumns 'RuleName', 'TargetName', 'Outcome', 'Synopsis';
2527+
```
2528+
2529+
```yaml
2530+
# YAML: Using the output/csvDetailedColumns property
2531+
output:
2532+
csvDetailedColumns:
2533+
- RuleName
2534+
- TargetName
2535+
- Outcome
2536+
- Synopsis
2537+
```
2538+
2539+
```bash
2540+
# Bash: Using environment variable
2541+
export PSRULE_OUTPUT_CSVDETAILEDCOLUMNS='RuleName;TargetName;Outcome;Synopsis'
2542+
```
2543+
2544+
```yaml
2545+
# GitHub Actions: Using environment variable
2546+
env:
2547+
PSRULE_OUTPUT_CSVDETAILEDCOLUMNS: 'RuleName;TargetName;Outcome;Synopsis'
2548+
```
2549+
2550+
```yaml
2551+
# Azure Pipelines: Using environment variable
2552+
variables:
2553+
- name: PSRULE_OUTPUT_CSVDETAILEDCOLUMNS
2554+
value: 'RuleName;TargetName;Outcome;Synopsis'
2555+
```
2556+
24912557
### Output.Encoding
24922558

24932559
Configures the encoding used when output is written to file.
@@ -3641,6 +3707,11 @@ logging:
36413707
output:
36423708
as: Summary
36433709
banner: Minimal
3710+
csvDetailedColumns:
3711+
- RuleName
3712+
- TargetName
3713+
- Outcome
3714+
- Synopsis
36443715
culture:
36453716
- en-US
36463717
encoding: UTF8
@@ -3783,6 +3854,14 @@ logging:
37833854
output:
37843855
as: Detail
37853856
banner: Default
3857+
csvDetailedColumns:
3858+
- RuleName
3859+
- TargetName
3860+
- TargetType
3861+
- Outcome
3862+
- OutcomeReason
3863+
- Synopsis
3864+
- Recommendation
37863865
culture: [ ]
37873866
encoding: Default
37883867
footer: Default

docs/updates/v3.0.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,3 +128,6 @@ Continue reading [Formats and emitters](../concepts/formats.md) to learn more.
128128
129129
- You can now override the options file that VSCode uses when running PSRule.
130130
- Previously only `ps-rule.yaml` was used by VSCode although PSRule generally supported changing the options file.
131+
- CSV output columns can be customized.
132+
- Previously the CSV output format had a fixed set of columns.
133+
- You can now customize the columns included in the CSV output through the `Output.CsvDetailedColumns` option.

0 commit comments

Comments
 (0)