Skip to content

Commit dddff05

Browse files
authored
fix UseCompatibleTypes.md title (#1177)
* Fix obvious cut/paste error for the topic title Add another example using a settings object
1 parent 724d2ad commit dddff05

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

RuleDocumentation/UseCompatibleTypes.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# UseCompatibleCommands
1+
# UseCompatibleTypes
22

33
**Severity Level: Warning**
44

@@ -88,4 +88,24 @@ An example configuration might look like:
8888
}
8989
}
9090
}
91-
```
91+
```
92+
93+
Alternatively, you could provide a settings object as follows:
94+
95+
```PowerShell
96+
PS> $settings = @{
97+
Rules = @{
98+
PSUseCompatibleTypes = @{
99+
Enable = $true
100+
TargetProfiles = @("win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework")
101+
}
102+
}
103+
}
104+
PS> Invoke-ScriptAnalyzer -Settings $settings -ScriptDefinition '[System.Management.Automation.SemanticVersion]"1.18.0-rc1"'
105+
106+
RuleName Severity ScriptName Line Message
107+
-------- -------- ---------- ---- -------
108+
PSUseCompatibleTypes Warning 1 The type 'System.Management.Automation.SemanticVersion' is
109+
not available by default in PowerShell version
110+
'5.1.17763.316' on platform 'Microsoft Windows 10 Pro'
111+
```

0 commit comments

Comments
 (0)