Prerequisites
Steps to reproduce
completionText, listItemText and toolTip are considered $null when is a empty string
This is undocumented and confusing.
[System.Management.Automation.CompletionResult]::new(
'foo', # completionText
'foo', # listItemText
[System.Management.Automation.CompletionResultType]::ParameterValue,
'' # toolTip
)
MethodInvocationException: Exception calling ".ctor" with "4" argument(s): "Cannot process argument because the value of argument "toolTip" is null. Change the
value of argument "toolTip" to a non-null value."
Expected behavior
Actual behavior
empty string is considered null
Error details
Environment data
Name Value
---- -----
PSVersion 7.5.4
PSEdition Core
GitCommitId 7.5.4
OS Microsoft Windows 10.0.19045
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Visuals
No response
Prerequisites
Steps to reproduce
completionText,listItemTextandtoolTipare considered$nullwhen is a empty stringThis is undocumented and confusing.
Expected behavior
Correct error messageActual behavior
empty string is considered nullError details
Environment data
Visuals
No response