สมมติว่าฉันพิมพ์ผิดในบรรทัดคำสั่ง:
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