From 8524a0d386c04f825809b5ae1758b88f9d83ee85 Mon Sep 17 00:00:00 2001 From: James Truher Date: Fri, 15 Mar 2019 12:09:22 -0700 Subject: [PATCH 1/3] Fix main header title to be correct Add another example using settings object rather than file --- RuleDocumentation/UseCompatibleTypes.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/RuleDocumentation/UseCompatibleTypes.md b/RuleDocumentation/UseCompatibleTypes.md index 2497bd042..4863f2005 100644 --- a/RuleDocumentation/UseCompatibleTypes.md +++ b/RuleDocumentation/UseCompatibleTypes.md @@ -1,4 +1,4 @@ -# UseCompatibleCommands +# UseCompatibleTypes **Severity Level: Warning** @@ -88,4 +88,24 @@ An example configuration might look like: } } } -``` \ No newline at end of file +``` + +Alternatively, you could provide a settings object as follows: + +```PowerShell +PS> $settings = @{ + Rules = @{ + PSUseCompatibleTypes = @{ + Enable = $true + TargetProfiles = @("win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework") + } + } +} +PS> Invoke-ScriptAnalyzer -Settings $settings -ScriptDefinition '[System.Management.Automation.SemanticVersion]"1.18.0-rc1"' + +RuleName Severity ScriptName Line Message +-------- -------- ---------- ---- ------- +PSUseCompatibleTypes Warning 1 The type 'System.Management.Automation.SemanticVersion' is + not available by default in PowerShell version + '5.1.17763.316' on platform 'Microsoft Windows 10 Pro' +``` From 713036770313642d71103c33e25b8b1927788df8 Mon Sep 17 00:00:00 2001 From: James Truher Date: Fri, 15 Mar 2019 12:09:42 -0700 Subject: [PATCH 2/3] Revert "Fix main header title to be correct" This reverts commit 8524a0d386c04f825809b5ae1758b88f9d83ee85. --- RuleDocumentation/UseCompatibleTypes.md | 24 ++---------------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/RuleDocumentation/UseCompatibleTypes.md b/RuleDocumentation/UseCompatibleTypes.md index 4863f2005..2497bd042 100644 --- a/RuleDocumentation/UseCompatibleTypes.md +++ b/RuleDocumentation/UseCompatibleTypes.md @@ -1,4 +1,4 @@ -# UseCompatibleTypes +# UseCompatibleCommands **Severity Level: Warning** @@ -88,24 +88,4 @@ An example configuration might look like: } } } -``` - -Alternatively, you could provide a settings object as follows: - -```PowerShell -PS> $settings = @{ - Rules = @{ - PSUseCompatibleTypes = @{ - Enable = $true - TargetProfiles = @("win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework") - } - } -} -PS> Invoke-ScriptAnalyzer -Settings $settings -ScriptDefinition '[System.Management.Automation.SemanticVersion]"1.18.0-rc1"' - -RuleName Severity ScriptName Line Message --------- -------- ---------- ---- ------- -PSUseCompatibleTypes Warning 1 The type 'System.Management.Automation.SemanticVersion' is - not available by default in PowerShell version - '5.1.17763.316' on platform 'Microsoft Windows 10 Pro' -``` +``` \ No newline at end of file From 7cb2e64b4c5ef46d62262675c99d1f775b720122 Mon Sep 17 00:00:00 2001 From: James Truher Date: Fri, 15 Mar 2019 12:13:53 -0700 Subject: [PATCH 3/3] Fix obvious cut/paste error for topic title Add another example using a settings object --- RuleDocumentation/UseCompatibleTypes.md | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/RuleDocumentation/UseCompatibleTypes.md b/RuleDocumentation/UseCompatibleTypes.md index 2497bd042..4863f2005 100644 --- a/RuleDocumentation/UseCompatibleTypes.md +++ b/RuleDocumentation/UseCompatibleTypes.md @@ -1,4 +1,4 @@ -# UseCompatibleCommands +# UseCompatibleTypes **Severity Level: Warning** @@ -88,4 +88,24 @@ An example configuration might look like: } } } -``` \ No newline at end of file +``` + +Alternatively, you could provide a settings object as follows: + +```PowerShell +PS> $settings = @{ + Rules = @{ + PSUseCompatibleTypes = @{ + Enable = $true + TargetProfiles = @("win-48_x64_10.0.17763.0_5.1.17763.316_x64_4.0.30319.42000_framework") + } + } +} +PS> Invoke-ScriptAnalyzer -Settings $settings -ScriptDefinition '[System.Management.Automation.SemanticVersion]"1.18.0-rc1"' + +RuleName Severity ScriptName Line Message +-------- -------- ---------- ---- ------- +PSUseCompatibleTypes Warning 1 The type 'System.Management.Automation.SemanticVersion' is + not available by default in PowerShell version + '5.1.17763.316' on platform 'Microsoft Windows 10 Pro' +```