Skip to content

Commit

Permalink
UseCompatibleCommands doc improvements
Browse files Browse the repository at this point in the history
- Correct typo in configuration example
- Add table explaining available configuration keys and how they work
  • Loading branch information
rjmholt committed Sep 21, 2019
1 parent 5e207aa commit 7874b55
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion RuleDocumentation/UseCompatibleCommands.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,21 @@ If a command is not present in the union profile, it is assumed to be locally cr
Otherwise, if a command is present in the union profile but not present in a target,
it is deemed to be incompatible with that target.

## Configuration settings

| Configuration key | Meaning | Accepted values | Mandatory | Example |
| ----------------- | ------- | --------------- | --------- | ------- |
| `Enable` | Activates the rule | bool (`$true`/`$false`) | No (default: `$false`) | `$true` |
| `TargetProfiles` | The list of PowerShell profiles to target | string[]: absolute paths to profile files or names of profiles in the profile directory | No (default: `@()`) | `@('ubuntu_x64_18.04_6.1.3_x64_4.0.30319.42000_core', 'win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework')` |
| `ProfileDirPath` | The location to search for profiles by name and use for union profile generation | string: absolute path to new profile dir | No (defaults to `compatibility_profiles` directory in PSScriptAnalyzer module | `C:\Users\me\Documents\pssaCompatProfiles` |
| `IgnoreCommands` | Commands to ignore compatibility of in scripts | string[]: names of commands to ignore | No (default: `@()`) | `@('Get-ChildItem','Import-Module')` |

An example configuration might look like:

```PowerShell
@{
Rules = @{
UseCompatibleCommmands = @{
PSUseCompatibleCommmands = @{
Enable = $true
TargetProfiles = @(
'ubuntu_x64_18.04_6.1.3_x64_4.0.30319.42000_core'
Expand Down

0 comments on commit 7874b55

Please sign in to comment.