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
{{ message }}
Repository navigation
Autocompletion gives no results for $PSItem / $_ in Catch blocks #7828
Despite the fact that catch blocks should always receive an ErrorRecord object as the $_ or $PSItem value, there is no autocompletion / type inference performed for its properties, nor those of the Exception and/or InnerExceptions it contains.
Steps to reproduce
try {
throw"nope"
}
catch {
$PSItem.{tab}
}
Expected behavior
$PSItem.CategoryInfo # And cycle through list of ErrorRecord properties on subsequent presses
(I know there's a programmatic way to get completion results, but I'm not familiar enough with how it works to be able to put that together at present.)
Actual behavior
$PSItem. # no completion results offered whatsoever
Environment data
>$PSVersionTable
Name Value
---------
PSVersion 6.1.0
PSEdition Core
GitCommitId 6.1.0
OS Microsoft Windows 10.0.17134
Platform Win32NT
PSCompatibleVersions {1.0,2.0,3.0,4.0...}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0
Activity
iSazonov commentedon Sep 20, 2018
Related #3373
BrucePay commentedon Sep 21, 2018
Ilya (@iSazonov) I'm not sure why this is marked as a question. It sounds like an enhancement request to me.
iSazonov commentedon Sep 21, 2018
Bruce Payette (@BrucePay) I do not know if it is possible to implement. If yes, then this is an enhancement.