.NET Logo
Welcome Guest Search | Active Topics | Members | Log In | Register

การใช้งาน PowerGadgets Options · View
paedotnet
Posted: Monday, December 31, 2007 6:07:13 AM

Rank: มือเทพ
Groups: Member

Joined: 12/6/2007
Posts: 344
Location: bkk

การใช้งาน PowerGadget
PowerGadget คือ การแสดงผลข้อมูลรูปแบบใหม่ที่อยู่ในรูปของ Chart ,รูปภาพ,Gauges,Maps ต่างๆ ซึ่ง powergadgets นี้จะทำงานร่วมกับคำสั่งของ powershell
ไป Download PowerGadget ได้ที่  http://www.powergadgets.com   (Trial Version)
สิ่งที่จำเป็นในการติดตั้ง PowerGadgets
Window XP,Window vista,Window Server 2003 หรือ Window Server "Longhorn"
Window PowerShell
.Net Framework 2.0
ตัวอย่างการใช้งาน powergadget
หลังจากที่ติดตั้งแล้วไปที่ start->all programs จะเห็น โปรแกรม powergadgets ดังรูป


ให้เลือก Window Powershell with PowerGadgets จากนั้นจะมีหน้าต่างขึ้นมาดังรูป

จากนั้นทดลองเขียนโค้ดดังนี้

Get-Process | Out-Chart
 
 
หลังจากนั้นกดปุ่ม  Enter แล้วจะมีผลลัพธ์ดังรูป

คำอธิบายคำสั่ง Out-Chart ทำหน้าที่แสดงแผนภูมิออกมาโดยในตัวอย่างนี้จะแสดงแผนภูมิเกี่ยวกับ โปรเซสต่างๆในเครื่องของเรา

ถ้าต้องการแสดงแผนภูมิของ Service ต่างๆ ก็เขียนได้ดังนี้


Get-Service | Out-Chart


ผลลัพธ์จะแสดงดังรูป

ถ้าต้องการแสดงเป็นภาพคล้ายๆ กับ GadGet ใน Window Vista ก็ใช้คำสั่ง Out-Gauge ได้
ดังนี้


Get-Process | Out-Gauge


ผลลัพธ์จะแสดงดังรูป

ถ้าต้องการแสดงเป็นภาพ map ก็ใช้คำสั่ง Out-Map ดังนี้

Get-Process | Out-Map


ผลลัพธ์แสดงดังรูป

การแสดงวันที่


Get-Data | Out-Gauge


ผลลัพธ์แสดงดังรูป

การแสดงเวลาแบบเปลียนแปลงได้

Get-Date | Out-Gauge -Type Digital -Refresh 0:0:1

ผลลัพธ์สังเกตว่าเวลาที่แสดงจะเปลี่ยนไปตามเวลาจริง

การแสดงโปรเซสแบบมีเงื่อนไข

Get-Process | Where{$_.Id -lt 1000} | Out-Chart
 
 
ผลลัพธ์แสดงดังรูป
 

คำอธิบายในตัวอย่างนี้จะแสดงรูปเฉพาะโปรเซสที่มี Id น้อยกว่า 1000

 

 

 


 



[With great power comes great responsibility]
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Powered by Yet Another Forum.net version 1.9.1.8 (NET v2.0) - 3/29/2008
Copyright © 2003-2008 Yet Another Forum.net. All rights reserved.


Sponsored by