File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ static SpecialVars()
9191 internal const string ConfirmPreference = "ConfirmPreference" ;
9292 internal const string ProgressPreference = "ProgressPreference" ;
9393 internal const string InformationPreference = "InformationPreference" ;
94+ internal const string ErrorView = "ErrorView" ;
9495
9596 internal static readonly string [ ] PreferenceVariables = new string [ ]
9697 {
@@ -101,7 +102,8 @@ static SpecialVars()
101102 WarningPreference ,
102103 ConfirmPreference ,
103104 ProgressPreference ,
104- InformationPreference
105+ InformationPreference ,
106+ ErrorView
105107 } ;
106108
107109 internal static readonly Type [ ] PreferenceVariableTypes = new Type [ ]
@@ -114,6 +116,7 @@ static SpecialVars()
114116 /* ConfirmPreference */ typeof ( ConfirmImpact ) ,
115117 /* ProgressPreference */ typeof ( Enum ) ,
116118 /* InformationPreference */ typeof ( ActionPreference ) ,
119+ /* ErrorView */ typeof ( Enum ) , //ErrorView type not available on PS3
117120 } ;
118121
119122 internal enum AutomaticVariable
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ function MyFunc2() {
7272 }
7373
7474 Context " When there are no violations" {
75+ It " No warning is issued for assignment without use of preference variable ErrorView" {
76+ $results = Invoke-ScriptAnalyzer - ScriptDefinition ' $ErrorView = NormalView'
77+ $results.Count | Should - Be 0
78+ }
79+
7580 It " returns no violations" {
7681 $noViolations.Count | Should - Be 0
7782 }
You can’t perform that action at this time.
0 commit comments