Допустим, я сделал опечатку в командной строке:
whih foo
Powershell возвращает:
whih : The term 'whih' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ whih mocha
+ ~~~~
+ CategoryInfo : ObjectNotFound: (whih:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Длинное сообщение полезно для сценариев, но для использования интерактивной оболочки я хотел бы заключить его в нечто более короткое, например:
'whih' isn't a cmdlet, function, script file, or operable program.
Можно ли обернуть ошибку и изменить ее на что-то более короткое?
try
. Просто ищу что-то для$profile
- person mikemaccana   schedule 02.08.2018