Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> ระบบ >> Windows

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

PowerShell help system เป็นสิ่งที่มีประโยชน์ที่สุดสำหรับการใช้ PowerShell ให้ได้ผล เนื่องจาก PowerShell เป็น shell ไม่มี graphical interface ไม่มีปุ่มหรือเมนูสวยงาม ต้องพิมพ์คำสั่งเพื่อดูผลลัพธ์ นี่คือที่ help system ช่วยเหลือ: นำทาง user ให้ครบคำสั่งที่ต้องการ หรือค้นหาคำสั่งเพื่อทำงาน

PowerShell Version 2 หรือ 3?

Windows 8 มาพร้อม PowerShell 3 ล่าสุด มีฟีเจอร์ของ v2 ทั้งหมด พร้อม enhancements และฟีเจอร์เพิ่มเติม โชคดีที่ Microsoft เก็บทั้งสอง version ไว้ใน Windows 8 ผู้ใช้รัน version ไหนก็ได้ ค่าเริ่มต้น "Run -> powershell.exe" จะเปิด PowerShell 3 ถ้าอยากเปิด v2 ใช้ syntax:

powershell.exe -version 2.0

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

รัน PS as administrator

สิ่งแรกควรทำ: รัน PowerShell as administrator เพื่อให้ update PS help system ได้ ใน Windows 8 ไป Search (Windows Key+Q) ค้น "PowerShell" ในผลลัพธ์ คลิกขวา "PowerShell" เลือก "run as administrator"

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

วิธีดีที่สุดเช็คว่า run as admin: title ของหน้าต่าง PowerShell เริ่มต้นด้วย "Administrator"

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

อัปเดต help

PowerShell ไม่มาพร้อม help system pre-installed ต้องติดตั้งด้วยคำสั่ง update อัปเดต help system ให้ล่าสุด ใช้คำสั่ง:

update-help

รันครั้งแรกจะใช้เวลาสแกน changes และ updates

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

สามารถดาวน์โหลด update file ไว้คอมพิวเตอร์ แล้วติดตั้งบนหลายเครื่องแบบ offline ใช้คำสั่ง:

save-help [destination path]

ติดตั้ง update file ล่าสุดบน offline computer ใช้:

update-help -SourcePath [source path]

คำสั่ง "update-help" อัปเดต help system ทุก 24 ชั่วโมง รันหลายครั้งในวันเดียว จะรันครั้งแรกแล้วไม่ทำอะไรอีก 24 ชม.

ใช้คำสั่ง help

เพื่อขอ help สำหรับแต่ละคำสั่ง ใช้ syntax:

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

help command-name

ตัวอย่าง:

help update-help

จะได้ข้อมูล syntax, synopsis และคำอธิบายรายละเอียดวิธีและเมื่อไหร่ใช้คำสั่ง

จุดเด่นของ help ใน PowerShell: user ได้ help เกือบทุกประเภทที่ต้องการสำหรับคำสั่งเฉพาะ ต้องการ real-life examples ใช้ syntax:

help update-help -examples

รายละเอียดเพิ่มเติม ใช้ -detailed แทน -examples และข้อมูลครบถ้วน ใช้ -full

ส่วนใหญ่ user อ่าน help files ขณะทำงานบน PowerShell เปิดหน้าต่างใหม่ของ help file เดียวกันได้ด้วยคำสั่ง:

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

help update-help -ShowWindow

จะโผล่ graphical window ใหม่พร้อม help ทั้งหมด ใช้ help คู่กับ PowerShell window ได้

ขอ help ออนไลน์

คนส่วนใหญ่ใช้ Google หาตัวอย่างคำสั่ง PowerShell ตอนเราเรียนรู้ใช้ help system ขอ help จริงจาก PowerShell help PowerShell ไม่ทิ้งเราแม้อยากไปออนไลน์

ใช้ PowerShell Help System อย่างมีประสิทธิภาพ

ไปออนไลน์ขอ help ใช้คำสั่ง:

help update-help -online

จะนำไปยัง PowerShell documentation site ได้ข้อมูลทุกอย่างเกี่ยวกับคำสั่ง PowerShell บางครั้งถ้า default browser ไม่ใช่ IE คำสั่งข้างต้น error ให้ไปที่ PowerShell documentation โดยตรง

หลังอ่านบทความนี้ หวังว่าจะสบายใจใช้ PowerShell มากขึ้น คุณใช้ help หรือ shortcuts ใน PowerShell ยังไง?