#Version 3.2 (non-remote edition)
␀瘀攀爀猀椀漀渀 㴀 ∀㌀⸀㐀∀ ⌀㰀㰀㰀㰀㰀㰀䌀䠀䄀一䜀䔀 吀䠀䤀匀 䄀一夀吀䤀䴀䔀 䴀伀䐀䤀䘀䤀䔀䐀℀ഀഊ<#
吀栀攀 昀漀氀氀漀眀椀渀最 椀渀昀漀爀洀愀琀椀漀渀 椀猀 爀攀瀀漀爀琀攀搀 甀瀀漀渀㨀ഀഊ(In HTML Report)
ⴀ匀礀猀琀攀洀 䤀渀昀漀爀洀愀琀椀漀渀 ഀഊ -System Uptime
ⴀ匀礀猀琀攀洀 䴀愀渀甀昀愀挀琀甀爀攀爀ഀഊ -System Model
ⴀ伀匀ഀഊ -CPU Name and Bit-ness
ⴀ䌀倀唀 䌀漀爀攀猀 ⠀倀栀礀猀椀挀愀氀 ☀ 䰀漀最椀挀愀氀⤀ഀഊ -CPU Usage %
ⴀ吀漀琀愀氀 刀䄀䴀ഀഊ -Free RAM
ⴀ倀攀爀挀攀渀琀 昀爀攀攀 刀䄀䴀ഀഊ -Power Plan (and advises High performance if it's not set)
ⴀ䐀椀猀欀 䤀渀昀漀 ☀ 倀攀爀昀漀爀洀愀渀挀攀ഀഊ -Physical Disk
ⴀ䴀漀搀攀氀ഀഊ -DeviceID
ⴀ匀椀稀攀 ⠀䜀䈀⤀ഀഊ -Disk# Name
ⴀ䄀瘀最䐀椀猀欀儀甀攀甀攀䰀攀渀最琀栀ഀഊ -% Idle Time
ⴀ─ 圀爀椀琀攀 吀椀洀攀ഀഊ -% Read Time
ⴀ圀爀椀琀攀 䤀伀倀匀ഀഊ -Read IOPS
ⴀ䴀攀洀漀爀礀 䤀渀昀漀爀洀愀琀椀漀渀ഀഊ -Memory Modules
ⴀ䴀漀搀甀氀攀 匀氀漀琀 一愀洀攀ഀഊ -Module Mfr
ⴀ䴀漀搀甀氀攀 倀愀爀琀 ⌀ഀഊ -Module Serial #
ⴀ䐀愀琀愀 圀椀搀琀栀ഀഊ -Form Factor
ⴀ吀礀瀀攀 ⠀匀漀洀攀琀椀洀攀猀 眀漀爀欀猀⸀⸀⸀ 搀攀瀀攀渀搀攀渀琀 漀渀 洀愀挀栀椀渀攀 䈀䤀伀匀 椀渀昀漀 洀愀搀攀 愀瘀椀氀愀戀氀攀 琀漀 圀䴀䤀ഀഊ -Module Capacity
ⴀ䴀漀搀甀氀攀 匀瀀攀攀搀ഀഊ
ⴀ 匀礀猀琀攀洀 倀爀漀挀攀猀猀攀猀 愀渀搀 匀攀爀瘀椀挀攀猀ഀഊ -System Processes - Top 10 Highest Memory Usage
ⴀ匀礀猀琀攀洀 匀攀爀瘀椀挀攀猀 ⴀ 匀琀漀瀀瀀攀搀ഀഊ -Startup Entries
ⴀ䔀渀瘀椀爀漀渀洀攀渀琀 嘀愀爀椀愀戀氀攀猀ഀഊ -Non-Windows Services
ⴀ一漀渀ⴀ匀琀愀渀搀愀爀搀 匀攀爀瘀椀挀攀 䄀挀挀漀甀渀琀猀ഀഊ -3rd party Scheduled Tasks
ⴀ一攀琀眀漀爀欀椀渀最 䤀渀昀漀爀洀愀琀椀漀渀ഀഊ -Active NICs
ⴀ䠀漀猀琀渀愀洀攀ഀഊ -NIC Name
ⴀ一攀琀眀漀爀欀㨀ഀഊ -Link Speed
ⴀ唀瀀 吀椀洀攀ഀഊ -MAC Address
ⴀ䤀倀 䄀搀搀爀攀猀猀ഀഊ -DHCP Server
ⴀ匀甀戀渀攀琀 䴀愀猀欀ഀഊ -Default Gateway
ⴀ䐀一匀 匀甀昀昀椀砀ഀഊ -DNS Servers
ⴀ刀漀甀琀攀 吀愀戀氀攀猀 ഀഊ-Event Logs
ⴀ䔀瘀攀渀琀 琀礀瀀攀 漀昀 攀椀琀栀攀爀 圀愀爀渀椀渀最Ⰰ 䔀爀爀漀爀Ⰰ 漀爀 䌀爀椀琀椀挀愀氀 眀椀琀栀椀渀 ㈀㐀 栀爀猀⸀ഀഊ-Software Information
ⴀ䤀渀猀琀愀氀氀攀搀 倀爀漀最爀愀洀猀ഀഊ -Installed .NET Version
ⴀ䤀渀猀琀愀氀氀攀搀 唀瀀搀愀琀攀猀ഀഊ -Loaded Windows Kernel Drivers - 3rd Party
⠀伀琀栀攀爀 䘀椀氀攀猀⤀ഀഊ*Application and System Event logs, ALL warnings errors, in evtx format
⨀䜀爀漀甀瀀 倀漀氀椀挀礀 猀攀琀琀椀渀最猀Ⰰ 椀渀 䠀吀䴀䰀 昀漀爀洀愀琀ഀഊAuthor: Vince Vardaro
开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开开ഀഊChange Log
㌀⸀㐀⸀ ഀഊ -Added .NET version detection
ഀഊ 3.3.0
ⴀ䄀搀搀攀搀 䐀椀猀欀 匀琀愀琀甀猀 昀爀漀洀 圀椀渀㌀㈀开䐀椀猀欀搀爀椀瘀攀 焀甀攀爀礀ഀഊ
㌀⸀㈀⸀ ഀഊ -CSS change
ⴀ䴀漀搀椀昀椀攀搀 䐀爀椀瘀攀爀 䘀甀渀挀琀椀漀渀 琀漀 猀栀漀眀 漀渀氀礀 ㌀爀搀 瀀愀爀琀礀 爀甀渀渀椀渀最 欀攀爀渀攀氀 搀爀椀瘀攀爀猀ഀഊ
㌀⸀⸀ ഀഊ -Changed System Info to its own function, slimming down repetative WMI queries
ⴀ䄀搀搀攀搀 䈀䤀伀匀 椀渀昀漀爀洀愀琀椀漀渀 椀昀 洀愀挀栀椀渀攀 椀猀 瀀栀礀猀椀挀愀氀Ⰰ 氀攀昀琀 漀甀琀 椀昀 瘀椀爀琀甀愀氀ഀഊ
㌀⸀ ⸀ ഀഊ -Environment Variables moved under Tasks
ⴀ䌀匀匀 挀栀愀渀最攀猀⸀ 䌀氀攀愀渀攀爀 氀漀漀欀Ⰰ 愀渀搀 挀氀攀愀渀攀爀 挀漀氀氀愀瀀猀椀戀氀攀猀ഀഊ -Added Get-WindowsDriver Function, added running drivers section in report
ⴀ刀攀洀漀瘀攀搀 䐀爀椀瘀攀爀ⴀ儀甀攀爀礀 昀甀渀挀琀椀漀渀Ⰰ 愀猀 眀攀氀氀 愀猀 攀砀瀀漀爀琀 搀爀椀瘀攀爀猀 琀漀 挀猀瘀 昀椀氀攀⸀ഀഊ -Embedded Images
ⴀ刀攀洀漀瘀攀搀 䌀匀嘀 圀椀渀搀漀眀猀 甀瀀搀愀琀攀猀 昀椀氀攀⸀ 刀攀搀甀渀搀愀渀琀ഀഊ -Added Get-WindowsDriver Function, added running drivers section in report
ⴀ䔀爀爀漀爀 栀愀渀搀氀椀渀最℀℀℀ 昀漀爀 爀愀渀搀漀洀 洀攀洀漀爀礀 氀攀愀欀 昀椀砀 愀渀搀 挀氀攀愀渀攀爀 漀甀琀瀀甀琀⸀ഀഊ -Verbose progress throughout script execution on screen.
ⴀ刀攀洀漀瘀攀搀 䄀搀搀ⴀ䠀吀䴀䰀䄀琀琀爀椀戀甀琀攀Ⰰ 爀攀瀀氀愀挀攀搀 眀椀琀栀 昀漀爀攀愀挀栀 ⴀ爀攀瀀氀愀挀攀ഀഊ -Progress Indicators, for sanity purposes on calls
ഀഊ 2.9.5
ⴀ䄀搀搀攀搀 挀漀氀氀愀瀀猀椀戀氀攀 洀愀樀漀爀 猀攀挀琀椀漀渀猀 漀昀 琀栀攀 爀攀瀀漀爀琀 琀栀爀漀甀最栀 䌀匀匀ഀഊ -Wording changes in report
ⴀ䌀氀攀愀渀攀搀 甀瀀 栀琀洀氀ഀഊ
㈀⸀㤀⸀㐀ഀഊ -Fixed Date sorting in windows updates listing (which allowed removing duplicate queries)
ⴀ刀攀洀漀瘀攀搀 搀漀甀戀氀攀 圀椀渀搀漀眀猀 唀瀀搀愀琀攀 眀洀椀 焀甀攀爀椀攀猀 昀漀爀 戀攀琀琀攀爀 瀀攀爀昀漀爀洀愀渀挀攀ഀഊ -Implemented "Top Processes" Bar chart function and implementation
㈀⸀㤀⸀㌀ഀഊ -Moved html sections around for more logical flow
ⴀ䤀渀挀漀爀瀀漀爀愀琀攀搀 渀攀眀 倀爀漀挀攀猀猀 䈀愀爀 挀栀愀爀琀 昀甀渀挀琀椀漀渀 䌀爀攀愀琀攀ⴀ倀爀漀挀䈀愀爀䌀栀愀爀琀Ⰰ 攀洀戀攀搀搀攀搀 瀀爀漀挀攀猀猀 戀愀爀 挀栀愀爀琀ഀഊ -Removed old "remote" commented code
㈀⸀㤀⸀㈀ഀഊ -Added Environment Variable section
ⴀ䌀栀愀渀最攀搀 琀攀砀琀 椀渀 猀礀猀琀攀洀 猀攀爀瘀椀挀攀猀 愀爀攀愀ഀഊ
㈀⸀㤀⸀ഀഊ -Added Get-MemoryStats function
ⴀ䄀搀搀攀搀 䴀攀洀漀爀礀 䴀漀搀甀氀攀 椀渀昀漀爀洀愀琀椀漀渀 猀攀挀琀椀漀渀 琀漀 爀攀瀀漀爀琀ഀഊ -Changed Memory table to show limited data when polling a VM, while pulling all data from a physical machine
ഀഊ 2.9.0
ⴀ䘀漀爀挀攀搀 挀栀攀挀欀 漀昀 愀搀洀椀渀 爀椀最栀琀猀 戀攀昀漀爀攀 攀砀攀挀甀琀椀漀渀⸀ 匀琀漀瀀猀 椀昀 渀漀琀 昀漀甀渀搀ഀഊ -Removed null entries from $softwarereport section
ഀഊ 2.8.9
ⴀ䄀搀搀攀搀 倀漀眀攀爀 倀氀愀渀 ⠀愀渀搀 愀搀瘀椀猀攀猀 䠀椀最栀 瀀攀爀昀漀爀洀愀渀挀攀 椀昀 椀琀✀猀 渀漀琀 猀攀琀Ⰰ 甀猀椀渀最 椀昀 攀氀猀攀 琀漀 猀攀琀 挀漀氀漀爀 琀漀 爀攀搀⼀戀漀氀搀⤀ഀഊ -Optimized some WMI queries, by using WQL to improve performance of script
ⴀ䘀椀砀攀搀 椀渀挀漀爀爀攀挀琀 栀攀愀搀椀渀最 漀渀 瀀栀礀猀椀挀愀氀 搀椀猀欀 瀀攀爀昀 挀漀甀渀琀攀爀猀⸀ 爀攀愀搀 琀椀洀攀 愀渀搀 眀爀椀琀攀 琀椀洀攀 眀攀爀攀 爀攀瘀攀爀猀攀搀ഀഊ -Fixed Auto-not-started services section. Start Mode now shows values
ⴀ䘀椀砀攀搀 倀爀漀挀攀猀猀 猀攀挀琀椀漀渀⸀⸀⸀ 栀愀搀 琀漀 猀漀爀琀 戀礀 眀漀爀欀椀渀最猀攀琀㘀㐀Ⰰ 一伀吀 圀匀 㨀⤀ഀഊ -Fixed query for logical disk section. Missing freespace object
ഀഊ 2.8.8
ⴀ䘀椀砀攀搀 洀攀洀漀爀礀 瘀愀氀甀攀 攀爀爀漀爀猀 椀渀 ∀吀漀瀀 倀爀漀挀攀猀猀∀ 猀攀挀琀椀漀渀猀⸀ 䌀栀愀渀最攀搀 琀漀 眀漀爀欀椀渀最猀攀琀㘀㐀⸀ഀഊ Now, WS MB column reflects SQL server memory consumption accurately. It also references the corresponding sources in Windows.
ഀഊ 2.8.7
ⴀ䄀搀搀攀搀 搀愀琀攀 愀渀搀 琀椀洀攀 椀渀琀漀 昀椀氀攀渀愀洀攀 漀昀 爀攀瀀漀爀琀Ⰰ 愀渀搀 椀洀愀最攀猀 猀漀 琀栀愀琀 爀攀瀀漀爀琀 挀愀渀 戀攀 猀挀栀攀搀甀氀攀搀 洀甀氀琀椀瀀氀攀 琀椀洀攀猀 愀渀搀 眀爀椀琀攀 爀攀瀀漀爀琀猀 椀渀琀漀 琀栀攀 猀愀洀攀 搀椀爀攀挀琀漀爀礀ഀഊ -*Fixed bug in chart image file names. apparently using a _ to seperate variables in the filename parameter doesn't work, leaving out the $computername part. Using a - fixes this
ഀഊ 2.8.6
ⴀ䌀栀愀渀最攀搀 倀椀攀 䌀栀愀爀琀 䘀甀渀挀琀椀漀渀猀Ⰰ 䄀搀搀攀搀 挀漀氀漀爀 挀漀搀椀渀最 愀渀搀 氀攀最攀渀搀猀Ⰰ 挀栀愀渀最攀搀 琀漀 搀漀渀甀琀 猀琀礀氀攀 最爀愀瀀栀ഀഊ -Minor Tweak in table hover color
ⴀ䔀砀挀攀瀀琀椀漀渀 栀愀渀搀氀椀渀最 椀渀 瀀爀漀挀攀猀猀 漀眀渀攀爀 昀攀愀琀甀爀攀ഀഊ 2.8.5
ⴀ䤀渀挀漀爀瀀漀爀愀琀攀搀 挀甀猀琀漀洀 䜀攀琀ⴀ一椀挀䤀渀昀漀 昀甀渀挀琀椀漀渀Ⰰ 甀渀椀昀礀椀渀最 一䤀䌀 椀渀昀漀爀洀愀琀椀漀渀 昀爀漀洀 ㈀ 猀攀瀀攀爀愀琀攀 圀䴀䤀 挀愀氀氀猀 椀渀琀漀 漀渀攀 琀愀戀氀攀ഀഊ -Change Network Adapter HTML layout to better fit new function results
ഀഊ 2.8.1
ⴀ䄀搀搀攀搀 䔀爀爀漀爀 䠀愀渀搀氀椀渀最 椀渀琀漀 瀀椀攀 挀栀愀爀琀 昀甀渀挀琀椀漀渀猀ഀഊ
㈀⸀㠀ഀഊ -CSS design change
ⴀ䰀愀礀漀甀琀 琀眀攀愀欀椀渀最 漀昀 䠀吀䴀䰀 琀愀戀氀攀猀ഀഊ -Added additional NIC information
ⴀ䌀氀攀愀渀 甀瀀 䠀吀䴀䰀 戀甀最猀 愀渀搀 猀瀀攀氀氀椀渀最 攀爀爀漀爀猀ഀഊ -Added process owner to processes table
ⴀ䌀栀愀渀最攀搀 唀瀀搀愀琀攀 焀甀攀爀礀 昀甀渀挀琀椀漀渀 琀漀 甀猀攀 最眀洀椀 椀渀猀琀攀愀搀 漀昀 眀洀椀挀ഀഊ -Made Update links CLICKABLE :)
ⴀ刀攀洀漀瘀攀 䘀椀爀攀眀愀氀氀 猀攀琀琀椀渀最猀 搀甀攀 琀漀 椀渀愀挀挀甀爀愀挀礀Ⰰ 愀渀搀 漀瘀攀爀 挀漀洀瀀氀椀挀愀琀攀搀 昀甀渀挀琀椀漀渀 甀猀攀搀⸀ 䤀渀瘀攀猀琀椀最愀琀椀渀最 漀琀栀攀爀 漀瀀琀椀漀渀猀ഀഊ
㈀⸀㜀ഀഊ -HTML design changes
ⴀ䌀栀愀渀最攀搀 䄀挀琀椀瘀攀 一䤀䌀 吀愀戀氀攀 栀攀愀搀攀爀猀 琀漀 愀 洀漀爀攀 攀渀最氀椀猀栀 昀爀椀攀渀搀氀礀 昀漀爀洀愀琀ഀഊ
㈀⸀㘀ഀഊ -Fixed CPU Info bug that showed null on some servers
ⴀ䄀搀搀攀搀 ⸀挀洀搀 䔀砀攀挀甀琀愀戀氀攀 琀漀 戀礀瀀愀猀猀 琀栀攀 瀀漀眀攀爀猀栀攀氀氀 攀砀攀挀甀琀椀漀渀 瀀漀氀椀挀礀 猀琀攀瀀猀 漀渀 漀琀栀攀爀 洀愀挀栀椀渀攀猀ഀഊ
㈀⸀㔀ഀഊ -Documented data gathered in script
ⴀ䄀搀搀攀搀 倀栀礀猀椀挀愀氀 搀椀猀欀 䤀渀昀漀爀洀愀琀椀漀渀ഀഊ -Removed Drive Type from "Logical disks" table
ⴀ䄀搀搀攀搀 倀栀礀猀椀挀愀氀 䐀椀猀欀 倀攀爀昀漀爀洀愀渀挀攀 圀䴀䤀 搀愀琀愀ഀഊ -Marked firewall settings in Security Settings category
ⴀ䄀搀搀攀搀 氀椀猀琀 椀渀猀琀愀氀氀攀搀 猀漀昀琀眀愀爀攀ഀഊ -Added more detail in driver report, made function based execute
ⴀ䘀椀砀攀搀 䐀愀琀攀 漀甀琀瀀甀琀 椀渀 䤀渀猀琀愀氀氀攀搀 匀漀昀琀眀愀爀攀ഀഊ -Added 32 bit Programs to program list
ⴀ䄀搀搀攀搀 一漀渀ⴀ圀椀渀搀漀眀猀 匀攀爀瘀椀挀攀猀 猀攀挀琀椀漀渀 椀渀 䠀吀䴀䰀 爀攀瀀漀爀琀ഀഊ
㈀⸀ ഀഊ -Added Functions Get-RemoteFirewallStatus, Get-RemoteRouteTable, Get-RemoteScheduledTasks
ⴀ䤀渀挀漀爀瀀漀爀愀琀攀搀 愀氀氀 昀甀渀挀琀椀漀渀猀 椀渀琀漀 爀攀瀀漀爀琀ഀഊ -Massive layout change to html and css of report
ⴀ䌀氀攀愀渀攀搀 甀瀀 栀琀洀氀ഀഊ -Specified WindowsCommandOutputRegion, moved driver query into it *Driver query broke, moved back to top.
ⴀ䴀漀瘀攀搀 最攀琀ⴀ眀椀渀攀瘀攀渀琀 昀椀氀琀攀爀 瘀愀爀椀愀戀氀攀猀 琀漀 瘀愀爀☀愀爀最 猀攀挀琀椀漀渀ഀഊ -Pull all warnings/errors from System and Application event logs with wevtutil and saved to file in evtx format
ⴀ倀甀氀氀 刀匀伀倀 眀椀琀栀 最瀀爀攀猀甀氀琀ഀഊ -Tidy up script region markers
ഀഊPowerShell Systems Report
䔀砀愀洀瀀氀攀 甀猀愀最攀㨀 ⸀尀匀礀猀琀攀洀猀刀攀瀀漀爀琀⸀瀀猀 ⸀尀氀椀猀琀⸀琀砀琀ഀഊRemember that list.txt is the file containing a list of Server names to run this against
倀愀爀琀猀 漀昀 猀挀爀椀瀀琀 挀漀洀洀攀渀琀攀搀 漀甀琀 ⠀⌀⤀Ⰰ 洀愀礀 戀攀 琀甀爀渀攀搀 戀愀挀欀 漀渀 琀漀 愀搀搀 洀甀氀琀椀瀀氀攀 挀漀洀瀀甀琀攀爀 愀戀椀氀椀琀礀 愀渀搀 攀洀愀椀氀 昀甀渀挀琀椀漀渀猀⸀ഀഊ#>
⌀爀攀最椀漀渀 嘀愀爀椀愀戀氀攀猀 愀渀搀 䄀爀最甀洀攀渀琀猀ഀഊ#$users = "youremail@yourcompany.com" # List of users to email your report to (separate by comma)
⌀␀昀爀漀洀攀洀愀椀氀 㴀 ∀礀漀甀爀攀洀愀椀氀䀀礀漀甀爀挀漀洀瀀愀渀礀⸀挀漀洀∀ഀഊ#$server = "yourmailserver.yourcompany.com" #enter your own SMTP server DNS name / IP address here
⌀␀氀椀猀琀 㴀 ␀愀爀最猀嬀 崀 ⌀吀栀椀猀 愀挀挀攀瀀琀猀 琀栀攀 愀爀最甀洀攀渀琀 礀漀甀 愀搀搀 琀漀 礀漀甀爀 猀挀栀攀搀甀氀攀搀 琀愀猀欀 昀漀爀 琀栀攀 氀椀猀琀 漀昀 猀攀爀瘀攀爀猀⸀ 椀⸀攀⸀ 氀椀猀琀⸀琀砀琀ഀഊ#region Admin Check
䤀昀 ⠀ⴀ一伀吀 ⠀嬀匀攀挀甀爀椀琀礀⸀倀爀椀渀挀椀瀀愀氀⸀圀椀渀搀漀眀猀倀爀椀渀挀椀瀀愀氀崀 嬀匀攀挀甀爀椀琀礀⸀倀爀椀渀挀椀瀀愀氀⸀圀椀渀搀漀眀猀䤀搀攀渀琀椀琀礀崀㨀㨀䜀攀琀䌀甀爀爀攀渀琀⠀⤀⤀⸀䤀猀䤀渀刀漀氀攀⠀怀ഀഊ [Security.Principal.WindowsBuiltInRole] “Administrator”))
笀ഀഊ Write-Warning “Administrator rights are required to run this script! Please re-run this script as an Administrator!”
匀琀愀爀琀ⴀ匀氀攀攀瀀 ⴀ匀攀挀漀渀搀猀 㔀ഀഊ Break
紀ഀഊ#endregion Admin Check
␀挀漀洀瀀甀琀攀爀 㴀 栀漀猀琀渀愀洀攀 ⌀最攀琀ⴀ挀漀渀琀攀渀琀 ␀氀椀猀琀 ⌀最爀愀戀 琀栀攀 渀愀洀攀猀 漀昀 琀栀攀 猀攀爀瘀攀爀猀⼀挀漀洀瀀甀琀攀爀猀 琀漀 挀栀攀挀欀 昀爀漀洀 琀栀攀 氀椀猀琀⸀琀砀琀 昀椀氀攀⸀ഀഊ# Set free disk space threshold below in percent (default at 10%)
⌀␀琀栀爀攀猀栀漀氀搀猀瀀愀挀攀 㴀 ㈀ ഀഊ[int]$ProcessNumToFetch = 10
␀刀甀渀䄀猀唀猀攀爀 㴀 嬀匀攀挀甀爀椀琀礀⸀倀爀椀渀挀椀瀀愀氀⸀圀椀渀搀漀眀猀䤀搀攀渀琀椀琀礀崀㨀㨀䜀攀琀䌀甀爀爀攀渀琀⠀⤀⸀一愀洀攀ഀഊ$ListOfAttachments = @()
␀刀攀瀀漀爀琀 㴀 䀀⠀⤀ഀഊ$date= Get-Date -format g
␀䐀愀琀攀䘀椀氀攀一愀洀攀㴀 䜀攀琀ⴀ䐀愀琀攀 ⴀ昀漀爀洀愀琀 䴀䴀䴀开搀搀开栀洀洀琀ഀഊ$SysEvtFilter = [xml]@'
㰀儀甀攀爀礀䰀椀猀琀㸀ഀഊ
㰀匀攀氀攀挀琀 倀愀琀栀㴀∀匀礀猀琀攀洀∀㸀⨀嬀匀礀猀琀攀洀嬀⠀䰀攀瘀攀氀㴀 漀爀 䰀攀瘀攀氀㴀㈀ 漀爀 䰀攀瘀攀氀㴀㌀⤀ 愀渀搀 吀椀洀攀䌀爀攀愀琀攀搀嬀琀椀洀攀搀椀昀昀⠀䀀匀礀猀琀攀洀吀椀洀攀⤀ ☀氀琀㬀㴀 㠀㘀㐀 崀崀崀㰀⼀匀攀氀攀挀琀㸀ഀഊ
㰀⼀儀甀攀爀礀䰀椀猀琀㸀ഀഊ'@
␀䄀瀀瀀䔀瘀琀䘀椀氀琀攀爀 㴀 嬀砀洀氀崀䀀✀ഀഊ
㰀儀甀攀爀礀 䤀搀㴀∀ ∀ 倀愀琀栀㴀∀䄀瀀瀀氀椀挀愀琀椀漀渀∀㸀ഀഊ
㰀⼀儀甀攀爀礀㸀ഀഊ
✀䀀ഀഊ$RedBang = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAA2FBMVEX///++MjLnalHTJyDVKy3veGf8p6Tpd2HWYl/UKiPvemncTU/leF3fWTf2kYjZPkDWLjDUXlnwhHXXOjTUSyrYaGf1iH7NS0ncYj/USy/eVjTPJxPMJwDMJwb1hnzYOz7ONAX8o6DVQxnhbG7NTE3QKhfZPkHWVS7SXlfic3XnbFTZU0P+/v7PVle1IiHMR0ieGwD1qqD3xLyzSTLLf3DPNBaQHwL99fTcalDjeHTCb2uOFQ7KJhL21MyGJxC3LhWoHQTvuKnkycKAHgjsrqb01tPmmYLSnpF1j2u3AAAAAXRSTlMAQObYZgAAAKxJREFUeF5lz0WWw0AMRVEXmZkdZmZmbNj/jlpKO6PcyT/1RioJkZyUI5FcB3KUF6LacQXEtvoqxPN1IeYLIXTfg0J6yoBSuh0tKR0oPSIR0yqA8+gCY5kQ0ga6P544KYRuDf38bnC6EMIS2q1mOCGErIzW1xtOBmHYLoKv7xNMewghCTTG2P5wZEwLEjxk6ric88mEu870/9SW0amCjtF6f2bcb4L+GN8f3/8DQgYUGINoSt8AAAAASUVORK5CYII='
␀刀攀搀䈀愀渀最䠀吀䴀䰀 㴀 ∀㰀椀洀最 猀爀挀㴀搀愀琀愀㨀椀洀愀最攀⼀瀀渀最㬀戀愀猀攀㘀㐀Ⰰ␀⠀␀刀攀搀䈀愀渀最⤀ 愀氀琀㴀✀䔀爀爀漀爀✀ 猀琀礀氀攀㴀✀瘀攀爀琀椀挀愀氀ⴀ愀氀椀最渀㨀洀椀搀搀氀攀㬀瀀愀搀搀椀渀最ⴀ爀椀最栀琀㨀㔀瀀砀㬀✀⼀㸀∀ഀഊ$YellowBang = 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAACdklEQVR42mVSTU8TURR9JCQsoJKIq0oUookpBkJnphqXtD+AX8BfcMOWD2PbtCaaYCKRIhRFi1q1Frvwk6ihKMFFi9ICg0BRISIFtbQKKe3xvjcd08LizH25953zzr13mNVqZS0tLQcw55TaVLcE1W3GvEtp0+/ZbDb9juCWkCghQOQKTt55XS8ghFxKhS7Co35mxcq6esyhdK8P1wGfmoCPTVgfrkfMLnVT7YBjPVFMbvh8uRHZD8eBGVkgO3lMtDJjlxr2t8qJJarc7s/Ro0C8GblcDvl8HtuTjdjw10K9JGO/C1bc16xDal2+ZiLrJ4A5CblsSohER05hc6wOiasmzDqV1uKZ6Q5EnCebmZdGIK4I7GxNCQf+C7X4GjqNdMhIGzGjRIA+hd6l89/66eXpBiJbgFipQCJA+XcmrPadRJzulmwhelGuWaD+dl/VAlEztdBM0yc3q0H8WHkvBNaCJhKg1ZILPqdpu1Lz/z+IO2TXhpesjzHgLWGcEGbILPViJTKAqSsMSR/lgoTHdO43IuZUXJzLB3eO97U3Wg48Z5rIG44y/H1RjRVfNZY8DNt3KfeQcJ9hz1cuNhInLqMfxPfbe0RTDxGeMk3oGcOftSB2kxEk+hjStyl3j8Cd3GH4df0w6J/xMepdKzzQ7GG0IPSEWljuxZfIoJjB1kCBzIVuEW6WgW+NcfsY0azBX7AZIDyiV4mw0MOg0gxSXv6yTmbIDzExTOEgM2BAZsiAtLcS6aEq7UxIDVYh6anEJiF1w0D3DiHDo4fqhO89dWCB9jPuiQ5ZDXdaFie6LIsiEsY7ZC12KovhLp7T60qhpqiB9rPuf+YeJOq16/K9AAAAAElFTkSuQmCC'
␀夀攀氀氀漀眀䈀愀渀最䠀吀䴀䰀 㴀 ∀㰀椀洀最 猀爀挀㴀搀愀琀愀㨀椀洀愀最攀⼀瀀渀最㬀戀愀猀攀㘀㐀Ⰰ␀⠀␀夀攀氀氀漀眀䈀愀渀最⤀ 愀氀琀㴀✀圀愀爀渀椀渀最✀ 猀琀礀氀攀㴀✀瘀攀爀琀椀挀愀氀ⴀ愀氀椀最渀㨀洀椀搀搀氀攀㬀瀀愀搀搀椀渀最ⴀ爀椀最栀琀㨀㔀瀀砀㬀✀⼀㸀∀ഀഊ#endregion Variables and Arguments
⌀爀攀最椀漀渀 䘀甀渀挀琀椀漀渀猀ഀഊFunction Get-SystemInformation {
瀀愀爀愀洀⠀ഀഊ [string[]]
␀䌀漀洀瀀甀琀攀爀一愀洀攀㴀␀攀渀瘀㨀挀漀洀瀀甀琀攀爀渀愀洀攀ഀഊ )
昀漀爀攀愀挀栀 ⠀␀挀漀洀瀀甀琀攀爀 椀渀 ␀䌀漀洀瀀甀琀攀爀一愀洀攀⤀ 笀ഀഊ
␀䌀漀洀瀀䤀渀昀漀 㴀 䜀攀琀ⴀ圀洀椀伀戀樀攀挀琀 ⴀ儀甀攀爀礀 ∀匀攀氀攀挀琀 䴀愀渀甀昀愀挀琀甀爀攀爀Ⰰ䴀漀搀攀氀 䘀刀伀䴀 圀椀渀㌀㈀开䌀漀洀瀀甀琀攀爀匀礀猀琀攀洀∀ ⴀ挀漀洀瀀甀琀攀爀渀愀洀攀 ␀挀漀洀瀀甀琀攀爀ഀഊ $W32OS = Get-WmiObject Win32_OperatingSystem -computername $computer
ഀഊ
␀䰀愀猀琀䈀漀漀琀唀瀀吀椀洀攀 㴀 ␀圀㌀㈀伀匀⸀䌀漀渀瘀攀爀琀吀漀䐀愀琀攀吀椀洀攀⠀␀圀㌀㈀伀匀⸀䰀愀猀琀䈀漀漀琀唀瀀吀椀洀攀⤀ഀഊ $Time = (Get-Date) - $LastBootUpTime
✀笀 㨀 紀 䐀愀礀猀Ⰰ 笀㨀 紀 䠀漀甀爀猀Ⰰ 笀㈀㨀 紀 䴀椀渀甀琀攀猀Ⰰ 笀㌀㨀 紀 匀攀挀漀渀搀猀✀ ⴀ昀 ␀吀椀洀攀⸀䐀愀礀猀Ⰰ ␀吀椀洀攀⸀䠀漀甀爀猀Ⰰ ␀吀椀洀攀⸀䴀椀渀甀琀攀猀Ⰰ ␀吀椀洀攀⸀匀攀挀漀渀搀猀簀匀攀琀ⴀ嘀愀爀椀愀戀氀攀 唀瀀琀椀洀攀ഀഊ $OSPowerInfo = Get-WmiObject -Namespace root\cimv2\power -Class win32_PowerPlan -computername $computer|Where-Object {$_.IsActive -eq "True"}|Select ElementName
␀䌀瀀甀䤀渀昀漀 㴀 䜀攀琀ⴀ圀洀椀伀戀樀攀挀琀 ⴀ䌀漀洀瀀甀琀攀爀一愀洀攀 ␀挀漀洀瀀甀琀攀爀 ⴀ䌀氀愀猀猀 眀椀渀㌀㈀开瀀爀漀挀攀猀猀漀爀 ഀഊ $CpuName = $CpuInfo|Select -First 1 -Expand Name
␀䌀瀀甀䄀搀搀爀 㴀 ␀䌀瀀甀䤀渀昀漀簀匀攀氀攀挀琀 ⴀ䘀椀爀猀琀 ⴀ䔀砀瀀愀渀搀 䐀愀琀愀圀椀搀琀栀ഀഊ $CpuCores = $CpuInfo|Select -expand NumberOfCores
␀䌀瀀甀䰀漀最倀爀漀挀 㴀 ␀䌀瀀甀䤀渀昀漀簀猀攀氀攀挀琀 ⴀ䔀砀瀀愀渀搀 一甀洀戀攀爀伀昀䰀漀最椀挀愀氀倀爀漀挀攀猀猀漀爀猀ഀഊ $CpuUsage = $CpuInfo|Select Loadpercentage | Measure-Object LoadPercentage -Average | Select-Object -expand Average
␀䈀䤀伀匀 㴀 䜀攀琀ⴀ圀洀椀伀戀樀攀挀琀 ⴀ挀漀洀瀀甀琀攀爀渀愀洀攀 ␀挀漀洀瀀甀琀攀爀 ⴀ儀甀攀爀礀 ∀匀䔀䰀䔀䌀吀 䴀愀渀甀昀愀挀琀甀爀攀爀Ⰰ匀䴀䈀䤀伀匀䈀䤀伀匀嘀攀爀猀椀漀渀Ⰰ刀攀氀攀愀猀攀䐀愀琀攀 䘀刀伀䴀 圀椀渀㌀㈀开䈀椀漀猀∀ഀഊ
␀匀礀猀琀攀洀䤀渀昀漀爀洀愀琀椀漀渀 㴀 一攀眀ⴀ伀戀樀攀挀琀 ⴀ吀礀瀀攀 倀匀伀戀樀攀挀琀 ⴀ倀爀漀瀀攀爀琀礀 䀀笀ഀഊ "System Manufacturer" = $CompInfo.Manufacturer
∀匀礀猀琀攀洀 䴀漀搀攀氀∀ 㴀 ␀䌀漀洀瀀䤀渀昀漀⸀䴀漀搀攀氀ഀഊ "BIOS Vendor" = $BIOS.Manufacturer
∀䈀䤀伀匀 嘀攀爀猀椀漀渀∀ 㴀 ␀䈀䤀伀匀⸀匀䴀䈀䤀伀匀䈀䤀伀匀嘀攀爀猀椀漀渀ഀഊ "BIOS Date" = ($BIOS.ConvertToDateTime($BIOS.ReleaseDate)).ToShortDateString()
∀䌀倀唀 一愀洀攀∀ 㴀 ⠀␀䌀瀀甀一愀洀攀⤀ ⬀ ✀ 砀✀ ⬀ ⠀␀䌀瀀甀䄀搀搀爀⤀ഀഊ "Physical CPU Cores" = $CpuCores|Measure -Sum|Select -ExpandProperty Sum
∀䰀漀最椀挀愀氀 䌀倀唀 䌀漀爀攀猀∀ 㴀 ␀䌀瀀甀䰀漀最倀爀漀挀簀䴀攀愀猀甀爀攀 ⴀ匀甀洀簀猀攀氀攀挀琀 ⴀ䔀砀瀀愀渀搀倀爀漀瀀攀爀琀礀 匀甀洀ഀഊ "System Uptime" = $Uptime
∀伀瀀攀爀愀琀椀渀最 匀礀猀琀攀洀∀ 㴀 ␀圀㌀㈀伀匀⸀挀愀瀀琀椀漀渀 ⬀ ⠀ ␀圀㌀㈀伀匀⸀䌀匀䐀嘀攀爀猀椀漀渀⤀ഀഊ "Power Plan" = if ($OSPowerInfo.ElementName -notlike "*Performance") {"$($OSPowerInfo.ElementName) (Recommended Plan: High Performance)"}
攀氀猀攀 笀␀伀匀倀漀眀攀爀䤀渀昀漀⸀䔀氀攀洀攀渀琀一愀洀攀紀ഀഊ "CPU % Usage" = [string](-join $CpuUsage,"%" ) -replace " ", ""
∀吀漀琀愀氀 刀䄀䴀 ⠀䜀䈀⤀∀ 㴀 嬀䴀愀琀栀崀㨀㨀刀漀甀渀搀⠀⠀␀圀㌀㈀伀匀⸀吀漀琀愀氀嘀椀猀椀戀氀攀䴀攀洀漀爀礀匀椀稀攀⼀䴀䈀⤀Ⰰ㈀⤀ഀഊ "Free RAM (GB)" = [Math]::Round(($W32OS.FreePhysicalMemory/1MB),2)
∀䘀爀攀攀 刀䄀䴀 ─∀ 㴀 嬀䴀愀琀栀崀㨀㨀刀漀甀渀搀⠀⠀⠀␀圀㌀㈀伀匀⸀䘀爀攀攀倀栀礀猀椀挀愀氀䴀攀洀漀爀礀⼀␀圀㌀㈀伀匀⸀吀漀琀愀氀嘀椀猀椀戀氀攀䴀攀洀漀爀礀匀椀稀攀⤀ ⨀ ⤀Ⰰ㈀⤀ഀഊ }
ഀഊ $SystemInformation
紀ഀഊ
紀 ഀഊFunction Create-ProcBarChart {
瀀愀爀愀洀⠀␀䌀漀洀瀀甀琀攀爀一愀洀攀 㴀 ␀攀渀瘀㨀挀漀洀瀀甀琀攀爀渀愀洀攀Ⰰഀഊ [int32]$ProcessNumber
⤀ഀഊ [void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
嬀瘀漀椀搀崀嬀刀攀昀氀攀挀琀椀漀渀⸀䄀猀猀攀洀戀氀礀崀㨀㨀䰀漀愀搀圀椀琀栀倀愀爀琀椀愀氀一愀洀攀⠀∀匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀∀⤀ഀഊ
⌀ 挀栀愀爀琀 漀戀樀攀挀琀ഀഊ try {
␀挀栀愀爀琀 㴀 一攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䌀栀愀爀琀ഀഊ $chart1.Width = 400
␀挀栀愀爀琀⸀䠀攀椀最栀琀 㴀 ㈀ ഀഊ $chart1.BackColor = [System.Drawing.Color]::White
ഀഊ# title
⌀嬀瘀漀椀搀崀␀挀栀愀爀琀⸀吀椀琀氀攀猀⸀䄀搀搀⠀∀吀漀瀀 ␀倀爀漀挀攀猀猀一甀洀戀攀爀 ⴀ 䴀攀洀漀爀礀 唀猀愀最攀∀⤀ഀഊ #$chart1.Titles[0].Font = "Arial,11pt"
⌀␀挀栀愀爀琀⸀吀椀琀氀攀猀嬀 崀⸀䄀氀椀最渀洀攀渀琀 㴀 ∀琀漀瀀䰀攀昀琀∀ഀഊ
⌀ 挀栀愀爀琀 愀爀攀愀ഀഊ $chartarea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea
␀挀栀愀爀琀愀爀攀愀⸀一愀洀攀 㴀 ∀䌀栀愀爀琀䄀爀攀愀∀ഀഊ $Chartarea.AxisX.MajorGrid.LineWidth = 0
␀䌀栀愀爀琀愀爀攀愀⸀䄀砀椀猀夀⸀䴀愀樀漀爀䜀爀椀搀⸀䰀椀渀攀圀椀搀琀栀 㴀 ഀഊ $chartarea.AxisY.Title = "Memory (MB)"
␀挀栀愀爀琀愀爀攀愀⸀䄀砀椀猀堀⸀吀椀琀氀攀 㴀 ∀倀爀漀挀攀猀猀 一愀洀攀∀ഀഊ $chartarea.AxisY.IsLogarithmic = $true
⌀␀挀栀愀爀琀愀爀攀愀⸀䄀砀椀猀夀⸀䤀渀琀攀爀瘀愀氀 㴀 ഀഊ $chartarea.AxisX.Interval = 1
␀挀栀愀爀琀⸀䌀栀愀爀琀䄀爀攀愀猀⸀䄀搀搀⠀␀挀栀愀爀琀愀爀攀愀⤀ഀഊ
⌀ 氀攀最攀渀搀ഀഊ $legend = New-Object system.Windows.Forms.DataVisualization.Charting.Legend
␀氀攀最攀渀搀⸀渀愀洀攀 㴀 ∀䰀攀最攀渀搀∀ഀഊ $legend.font = "Arial"
␀䰀攀最攀渀搀⸀搀漀挀欀椀渀最 㴀 ∀吀漀瀀∀ഀഊ $Legend.title = "Processes"
␀䰀攀最攀渀搀⸀吀椀琀氀攀䘀漀渀琀 㴀∀䄀爀椀愀氀∀ഀഊ $legend.alignment = "center"
␀䰀攀最攀渀搀⸀䤀猀琀攀砀琀愀甀琀漀昀椀琀 㴀 ␀琀爀甀攀ഀഊ $chart1.Legends.Add($legend)
ഀഊ
⌀ 搀愀琀愀 猀漀甀爀挀攀ഀഊ $datasource = Get-Process |Select Name,ID,WorkingSet64 | sort WorkingSet64 -Descending | Select-Object -First $ProcessNumber
ഀഊ# data series
嬀瘀漀椀搀崀␀挀栀愀爀琀⸀匀攀爀椀攀猀⸀䄀搀搀⠀∀圀匀䴀攀洀∀⤀ഀഊ $chart1.Series["WSMem"].ChartType = "Column"
␀挀栀愀爀琀⸀匀攀爀椀攀猀嬀∀圀匀䴀攀洀∀崀⸀䤀猀嘀椀猀椀戀氀攀䤀渀䰀攀最攀渀搀 㴀 ␀昀愀氀猀攀ഀഊ #$chart1.Series["WSMem"].IsVisibleInLegend = $true
␀挀栀愀爀琀⸀匀攀爀椀攀猀嬀∀圀匀䴀攀洀∀崀⸀䈀漀爀搀攀爀圀椀搀琀栀 㴀 ㌀ഀഊ $chart1.Series["WSMem"].chartarea = "ChartArea1"
␀挀栀愀爀琀⸀匀攀爀椀攀猀嬀∀圀匀䴀攀洀∀崀⸀䰀攀最攀渀搀 㴀 ∀䰀攀最攀渀搀∀ഀഊ $chart1.Series["WSMem"].Palette = "SemiTransparent"
␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀圀匀䴀攀洀∀崀嬀∀䐀爀愀眀椀渀最匀琀礀氀攀∀崀 㴀 ∀䌀礀氀椀渀搀攀爀∀ഀഊ $datasource | ForEach-Object {$chart1.Series["WSMem"].Points.addxy( ("PID "+$_.ID +" "+([Math]::Round($_.WorkingSet64 / 1mb))+" MB") , ([Math]::Round($_.WorkingSet64 / 1mb))) }
ഀഊ
⌀ 猀愀瘀攀 挀栀愀爀琀ഀഊ $chart1.SaveImage($env:tmp + "\ProcBar-"+$computername +".png","png")
紀 ഀഊ catch {
∀䔀爀爀漀爀 挀爀攀愀琀椀渀最 挀栀愀爀琀⸀ 嘀攀爀椀昀礀 䴀椀挀爀漀猀漀昀琀 䌀栀愀爀琀 䌀漀渀琀爀漀氀猀 昀漀爀 䴀椀挀爀漀猀漀昀琀 ⸀一䔀吀 䘀爀愀洀攀眀漀爀欀 ㌀⸀㔀 椀猀 椀渀猀琀愀氀氀攀搀∀ഀഊ }
紀ഀഊFunction Create-RAMPieChart {
瀀愀爀愀洀⠀␀䌀漀洀瀀甀琀攀爀一愀洀攀 㴀 ␀攀渀瘀㨀挀漀洀瀀甀琀攀爀渀愀洀攀ഀഊ )
ഀഊ [void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
嬀瘀漀椀搀崀嬀刀攀昀氀攀挀琀椀漀渀⸀䄀猀猀攀洀戀氀礀崀㨀㨀䰀漀愀搀圀椀琀栀倀愀爀琀椀愀氀一愀洀攀⠀∀匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀∀⤀ഀഊ
⌀䜀愀琀栀攀爀 刀䄀䴀 䐀愀琀愀ഀഊ $SystemInfo = Get-WmiObject -Class Win32_OperatingSystem -ComputerName $ComputerName | Select-Object Name, TotalVisibleMemorySize, FreePhysicalMemory
␀吀漀琀愀氀刀䄀䴀 㴀 ␀匀礀猀琀攀洀䤀渀昀漀⸀吀漀琀愀氀嘀椀猀椀戀氀攀䴀攀洀漀爀礀匀椀稀攀⼀䴀䈀ഀഊ $FreeRAM = $SystemInfo.FreePhysicalMemory/1MB
␀唀猀攀搀刀䄀䴀 㴀 ␀吀漀琀愀氀刀䄀䴀 ⴀ ␀䘀爀攀攀刀䄀䴀ഀഊ $RAMPercentFree = ($FreeRAM / $TotalRAM) * 100
␀䘀爀攀攀 㴀 嬀䴀愀琀栀崀㨀㨀刀漀甀渀搀⠀␀䘀爀攀攀刀䄀䴀Ⰰ ㈀⤀ഀഊ $Used = [Math]::Round($UsedRAM, 2)
ഀഊ
⌀䌀爀攀愀琀攀 漀甀爀 挀栀愀爀琀 漀戀樀攀挀琀ഀഊ try {
␀䌀栀愀爀琀 㴀 一攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䌀栀愀爀琀 ഀഊ $Chart.Width = 200
␀䌀栀愀爀琀⸀䠀攀椀最栀琀 㴀 ㈀ ഀഊ $Chart.Left = 10
␀䌀栀愀爀琀⸀吀漀瀀 㴀 ഀഊ
⌀䌀爀攀愀琀攀 愀 挀栀愀爀琀愀爀攀愀 琀漀 搀爀愀眀 漀渀 愀渀搀 愀搀搀 琀栀椀猀 琀漀 琀栀攀 挀栀愀爀琀ഀഊ $ChartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea
␀䌀栀愀爀琀⸀䌀栀愀爀琀䄀爀攀愀猀⸀䄀搀搀⠀␀䌀栀愀爀琀䄀爀攀愀⤀ഀഊ [void]$Chart.Series.Add("Data")
⌀䄀搀搀 愀 搀愀琀愀瀀漀椀渀琀 昀漀爀 攀愀挀栀 瘀愀氀甀攀 猀瀀攀挀椀昀椀攀搀 椀渀 琀栀攀 愀爀最甀洀攀渀琀猀 ⠀愀爀最猀⤀ഀഊ Write-Host "Now processing chart value: " + $used
␀搀愀琀愀瀀漀椀渀琀 㴀 渀攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䐀愀琀愀倀漀椀渀琀⠀ Ⰰ ␀唀猀攀搀⤀ഀഊ $datapoint.AxisLabel = "$used GB Used"
␀搀愀琀愀瀀漀椀渀琀⸀䌀漀氀漀爀 㴀∀䘀椀爀攀䈀爀椀挀欀∀ഀഊ $Chart.Series["Data"].Points.Add($datapoint)
ഀഊ Write-Host "Now processing chart value: " + $Free
␀搀愀琀愀瀀漀椀渀琀 㴀 渀攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䐀愀琀愀倀漀椀渀琀⠀ Ⰰ ␀䘀爀攀攀⤀ഀഊ $datapoint1.AxisLabel = "$Free GB Free"
␀搀愀琀愀瀀漀椀渀琀⸀䌀漀氀漀爀 㴀∀䐀漀搀最攀爀䈀氀甀攀∀ഀഊ $Chart.Series["Data"].Points.Add($datapoint1)
ഀഊ
␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀䐀愀琀愀∀崀⸀䌀栀愀爀琀吀礀瀀攀 㴀 嬀匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀匀攀爀椀攀猀䌀栀愀爀琀吀礀瀀攀崀㨀㨀䐀漀甀最栀渀甀琀ഀഊ $Chart.Series["Data"]["PieLabelStyle"] = "Outside"
␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀䐀愀琀愀∀崀嬀∀倀椀攀䰀椀渀攀䌀漀氀漀爀∀崀 㴀 ∀䈀氀愀挀欀∀ഀഊ $Chart.Series["Data"]["PieDrawingStyle"] = "Concave"
⠀␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀䐀愀琀愀∀崀⸀倀漀椀渀琀猀⸀䘀椀渀搀䴀愀砀䈀礀嘀愀氀甀攀⠀⤀⤀嬀∀䔀砀瀀氀漀搀攀搀∀崀 㴀 ␀琀爀甀攀ഀഊ $Chart.Series["Data"].Font = "Arial"
ഀഊ # Create chart legend
␀氀攀最攀渀搀 㴀 一攀眀ⴀ伀戀樀攀挀琀 猀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䰀攀最攀渀搀ഀഊ $legend.name = "Legend1"
␀氀攀最攀渀搀⸀昀漀渀琀 㴀 ∀䄀爀椀愀氀∀ഀഊ $Legend.docking = "Top"
␀䰀攀最攀渀搀⸀琀椀琀氀攀 㴀 ∀刀䄀䴀 唀猀愀最攀∀ഀഊ $Legend.TitleFont ="Arial"
␀氀攀最攀渀搀⸀愀氀椀最渀洀攀渀琀 㴀 ∀挀攀渀琀攀爀∀ഀഊ $Legend.Istextautofit = $true
ഀഊ
⌀ 䄀搀搀 挀栀愀爀琀 氀攀最攀渀搀 琀漀 挀栀愀爀琀 漀戀樀攀挀琀ഀഊ $chart.legends.add($legend)
ഀഊ #Set the title of the Chart to the current date and time
⌀␀吀椀琀氀攀 㴀 渀攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀吀椀琀氀攀ഀഊ #$Chart.Titles.Add($Title)
⌀␀䌀栀愀爀琀⸀吀椀琀氀攀猀嬀 崀⸀吀攀砀琀 㴀 ∀刀䄀䴀 唀猀愀最攀∀ഀഊ #$Chart.Titles[0].Font = "Arial"
⌀匀愀瘀攀 琀栀攀 挀栀愀爀琀 琀漀 愀 昀椀氀攀ഀഊ $Chart.SaveImage($env:temp + "\RAM-"+$computername + ".png","png")
ഀഊ }
挀愀琀挀栀 笀ഀഊ "Error creating chart. Verify Microsoft Chart Controls for Microsoft .NET Framework 3.5 is installed"
紀 ഀഊ}
䘀甀渀挀琀椀漀渀 䌀爀攀愀琀攀ⴀ䌀倀唀倀椀攀䌀栀愀爀琀 笀ഀഊ param($ComputerName = $env:computername
⤀ഀഊ
嬀瘀漀椀搀崀嬀刀攀昀氀攀挀琀椀漀渀⸀䄀猀猀攀洀戀氀礀崀㨀㨀䰀漀愀搀圀椀琀栀倀愀爀琀椀愀氀一愀洀攀⠀∀匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀∀⤀ഀഊ [void][Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms.DataVisualization")
ഀഊ #Get CPU Data
␀䌀瀀甀䤀渀昀漀 㴀 䜀攀琀ⴀ圀洀椀伀戀樀攀挀琀 ⴀ䌀漀洀瀀甀琀攀爀一愀洀攀 ␀挀漀洀瀀甀琀攀爀渀愀洀攀 ⴀ䌀氀愀猀猀 眀椀渀㌀㈀开瀀爀漀挀攀猀猀漀爀ഀഊ $CpuName = $CpuInfo|Select -First 1 -Expand Name
␀䌀瀀甀䄀搀搀爀 㴀 ␀䌀瀀甀䤀渀昀漀簀匀攀氀攀挀琀 ⴀ䘀椀爀猀琀 ⴀ䔀砀瀀愀渀搀 䐀愀琀愀圀椀搀琀栀ഀഊ $CpuCores = $CpuInfo|Select -expand NumberOfCores
␀䌀瀀甀唀猀愀最攀 㴀 ␀䌀瀀甀䤀渀昀漀簀匀攀氀攀挀琀 䰀漀愀搀瀀攀爀挀攀渀琀愀最攀 簀 䴀攀愀猀甀爀攀ⴀ伀戀樀攀挀琀 䰀漀愀搀倀攀爀挀攀渀琀愀最攀 ⴀ䄀瘀攀爀愀最攀 簀 匀攀氀攀挀琀ⴀ伀戀樀攀挀琀 ⴀ攀砀瀀愀渀搀 䄀瘀攀爀愀最攀ഀഊ $CpuFree = 100 - [int]$CpuUsage
ഀഊ
⌀䌀爀攀愀琀攀 漀甀爀 挀栀愀爀琀 漀戀樀攀挀琀ഀഊ try {
␀䌀栀愀爀琀 㴀 一攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䌀栀愀爀琀 ഀഊ $Chart.Width = 200
␀䌀栀愀爀琀⸀䠀攀椀最栀琀 㴀 ㈀ ഀഊ $Chart.Left = 10
␀䌀栀愀爀琀⸀吀漀瀀 㴀 ഀഊ
⌀䌀爀攀愀琀攀 愀 挀栀愀爀琀愀爀攀愀 琀漀 搀爀愀眀 漀渀 愀渀搀 愀搀搀 琀栀椀猀 琀漀 琀栀攀 挀栀愀爀琀ഀഊ $ChartArea = New-Object System.Windows.Forms.DataVisualization.Charting.ChartArea
␀䌀栀愀爀琀⸀䌀栀愀爀琀䄀爀攀愀猀⸀䄀搀搀⠀␀䌀栀愀爀琀䄀爀攀愀⤀ഀഊ [void]$Chart.Series.Add("Data")
⌀䄀搀搀 愀 搀愀琀愀瀀漀椀渀琀 昀漀爀 攀愀挀栀 瘀愀氀甀攀 猀瀀攀挀椀昀椀攀搀 椀渀 琀栀攀 愀爀最甀洀攀渀琀猀 ⠀愀爀最猀⤀ഀഊ Write-Host "Now processing chart value: " + $CpuUsage
␀搀愀琀愀瀀漀椀渀琀 㴀 渀攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䐀愀琀愀倀漀椀渀琀⠀ Ⰰ ␀䌀瀀甀唀猀愀最攀⤀ഀഊ $datapoint.AxisLabel = "$CpuUsage% Used"
␀搀愀琀愀瀀漀椀渀琀⸀䌀漀氀漀爀 㴀∀䘀椀爀攀䈀爀椀挀欀∀ഀഊ $Chart.Series["Data"].Points.Add($datapoint)
ഀഊ Write-Host "Now processing chart value: " + $CpuFree
␀搀愀琀愀瀀漀椀渀琀 㴀 渀攀眀ⴀ漀戀樀攀挀琀 匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䐀愀琀愀倀漀椀渀琀⠀ Ⰰ ␀䌀瀀甀䘀爀攀攀⤀ഀഊ $datapoint1.AxisLabel = "$CPUFree% Free"
␀搀愀琀愀瀀漀椀渀琀⸀䌀漀氀漀爀 㴀∀䐀漀搀最攀爀䈀氀甀攀∀ഀഊ $Chart.Series["Data"].Points.Add($datapoint1)
ഀഊ
␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀䐀愀琀愀∀崀⸀䌀栀愀爀琀吀礀瀀攀 㴀 嬀匀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀匀攀爀椀攀猀䌀栀愀爀琀吀礀瀀攀崀㨀㨀䐀漀甀最栀渀甀琀ഀഊ $Chart.Series["Data"]["PieLabelStyle"] = "Outside"
␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀䐀愀琀愀∀崀嬀∀倀椀攀䰀椀渀攀䌀漀氀漀爀∀崀 㴀 ∀䈀氀愀挀欀∀ഀഊ $Chart.Series["Data"]["PieDrawingStyle"] = "Concave"
⠀␀䌀栀愀爀琀⸀匀攀爀椀攀猀嬀∀䐀愀琀愀∀崀⸀倀漀椀渀琀猀⸀䘀椀渀搀䴀愀砀䈀礀嘀愀氀甀攀⠀⤀⤀嬀∀䔀砀瀀氀漀搀攀搀∀崀 㴀 ␀琀爀甀攀ഀഊ $Chart.Series["Data"].Font = "Arial"
ഀഊ # Create chart legend
␀氀攀最攀渀搀 㴀 一攀眀ⴀ伀戀樀攀挀琀 猀礀猀琀攀洀⸀圀椀渀搀漀眀猀⸀䘀漀爀洀猀⸀䐀愀琀愀嘀椀猀甀愀氀椀稀愀琀椀漀渀⸀䌀栀愀爀琀椀渀最⸀䰀攀最攀渀搀ഀഊ $legend.name = "Legend1"
␀氀攀最攀渀搀⸀昀漀渀琀 㴀 ∀䄀爀椀愀氀∀ഀഊ $Legend.docking = "Top"
␀䰀攀最攀渀搀⸀琀椀琀氀攀 㴀 ∀䌀倀唀 唀猀愀最攀∀ഀഊ $Legend.TitleFont ="Arial"
␀氀攀最攀渀搀⸀愀氀椀最渀洀攀渀琀 㴀 ∀挀攀渀琀攀爀∀ഀഊ $Legend.Istextautofit = $true
ഀഊ
⌀ 䄀搀搀 挀栀愀爀琀 氀攀最攀渀搀 琀漀 挀栀愀爀琀 漀戀樀攀挀琀ഀഊ $chart.legends.add($legend)
ഀഊ #Save the chart to a file
␀䌀栀愀爀琀⸀匀愀瘀攀䤀洀愀最攀⠀␀攀渀瘀㨀琀洀瀀 ⬀ ∀尀䌀倀唀ⴀ∀⬀␀挀漀洀瀀甀琀攀爀渀愀洀攀 ⬀ ∀⸀瀀渀最∀Ⰰ∀瀀渀最∀⤀ഀഊ }
挀愀琀挀栀 笀ഀഊ "Error creating chart. Verify Microsoft Chart Controls for Microsoft .NET Framework 3.5 is installed"
紀ഀഊ}
䘀甀渀挀琀椀漀渀 䜀攀琀ⴀ刀攀洀漀琀攀刀漀甀琀攀吀愀戀氀攀 笀ഀഊ <#
⸀匀夀一伀倀匀䤀匀ഀഊ Gathers remote system route entries.
⸀䐀䔀匀䌀刀䤀倀吀䤀伀一ഀഊ Gathers remote system route entries, including persistent routes. Utilizes multiple runspaces and
愀氀琀攀爀渀愀琀攀 挀爀攀搀攀渀琀椀愀氀猀 椀昀 搀攀猀椀爀攀搀⸀ഀഊ .PARAMETER ComputerName
匀瀀攀挀椀昀椀攀猀 琀栀攀 琀愀爀最攀琀 挀漀洀瀀甀琀攀爀 昀漀爀 搀愀琀愀 焀甀攀爀礀⸀ഀഊ .PARAMETER ThrottleLimit
匀瀀攀挀椀昀椀攀猀 琀栀攀 洀愀砀椀洀甀洀 渀甀洀戀攀爀 漀昀 猀礀猀琀攀洀猀 琀漀 椀渀瘀攀渀琀漀爀礀 猀椀洀甀氀琀愀渀攀漀甀猀氀礀ഀഊ .PARAMETER Timeout
匀瀀攀挀椀昀椀攀猀 琀栀攀 洀愀砀椀洀甀洀 琀椀洀攀 椀渀 猀攀挀漀渀搀 挀漀洀洀愀渀搀 挀愀渀 爀甀渀 椀渀 戀愀挀欀最爀漀甀渀搀 戀攀昀漀爀攀 琀攀爀洀椀渀愀琀椀渀最 琀栀椀猀 琀栀爀攀愀搀⸀ഀഊ .PARAMETER ShowProgress
匀栀漀眀 瀀爀漀最爀攀猀猀 戀愀爀 椀渀昀漀爀洀愀琀椀漀渀ഀഊ .EXAMPLE
倀匀 㸀 䜀攀琀ⴀ刀攀洀漀琀攀刀漀甀琀攀吀愀戀氀攀ഀഊ