File tree 2 files changed +9
-1
lines changed
2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,7 @@ static SpecialVars()
91
91
internal const string ConfirmPreference = "ConfirmPreference" ;
92
92
internal const string ProgressPreference = "ProgressPreference" ;
93
93
internal const string InformationPreference = "InformationPreference" ;
94
+ internal const string ErrorView = "ErrorView" ;
94
95
95
96
internal static readonly string [ ] PreferenceVariables = new string [ ]
96
97
{
@@ -101,7 +102,8 @@ static SpecialVars()
101
102
WarningPreference ,
102
103
ConfirmPreference ,
103
104
ProgressPreference ,
104
- InformationPreference
105
+ InformationPreference ,
106
+ ErrorView
105
107
} ;
106
108
107
109
internal static readonly Type [ ] PreferenceVariableTypes = new Type [ ]
@@ -114,6 +116,7 @@ static SpecialVars()
114
116
/* ConfirmPreference */ typeof ( ConfirmImpact ) ,
115
117
/* ProgressPreference */ typeof ( Enum ) ,
116
118
/* InformationPreference */ typeof ( ActionPreference ) ,
119
+ /* ErrorView */ typeof ( Enum ) , //ErrorView type not available on PS3
117
120
} ;
118
121
119
122
internal enum AutomaticVariable
Original file line number Diff line number Diff line change @@ -72,6 +72,11 @@ function MyFunc2() {
72
72
}
73
73
74
74
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
+
75
80
It " returns no violations" {
76
81
$noViolations.Count | Should - Be 0
77
82
}
You can’t perform that action at this time.
0 commit comments