You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RuleName Severity ScriptName Line Message
-------- -------- ---------- ---- -------
PSUseOutputTypeCorrectly Information 4 The cmdlet 'Test' returns an object of type
'System.Windows.Forms.DialogResult' but this type is
not declared in the OutputType attribute.
Other tests with a type shortcut and a full type name, but with a property name has a different case
$s=@' Function Test{ [CmdletBinding()] param() [datetime]::Now > $null }'@Invoke-ScriptAnalyzer-ScriptDefinition $s$s=@' Function Test{ [CmdletBinding()] param() [datetime]::now > $null }'@Invoke-ScriptAnalyzer-ScriptDefinition $s$s=@' Function Test{ [CmdletBinding()] param() [datetime]::FromFileTime(1) > $null }'@Invoke-ScriptAnalyzer-ScriptDefinition $s$s=@' Function Test{ [CmdletBinding()] param() [System.Datetime]::now > $null }'@Invoke-ScriptAnalyzer-ScriptDefinition $s$s=@' Function Test{ [CmdletBinding()] param() [System.Datetime]::Now > $null }'@Invoke-ScriptAnalyzer-ScriptDefinition $s
The code of the last two examples is identical except for the case of the property.
The triggering of the PSUseOutputTypeCorrectly rule seems to be case sensitive.
The text was updated successfully, but these errors were encountered:
@LaurentDardenne Not all examples reproduce for me, like for example the first one but some do. I see this as low priority and have therefore marked it as up for grabs
@bergmeister related to this, simply redirecting to a file, a common operation which does not actually produce an output, triggers the info as a false positive
Steps to reproduce
Expected behavior
Actual behavior
Environment data
Other tests with a type shortcut and a full type name, but with a property name has a different case
The code of the last two examples is identical except for the case of the property.
The triggering of the PSUseOutputTypeCorrectly rule seems to be case sensitive.
The text was updated successfully, but these errors were encountered: