windows-system-performance-check
Installation
Review the source and dependencies with a prompt. A package is available to download.
Install with an AI assistant
Copy the prompt so your assistant can review the pinned revision and dependencies first.
View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "windows-system-performance-check" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-7dfb23d367e24207c089741ce48fabeb49307d450aa7db6616a0c2917d4f15b5. Verify the upstream source and version against https://skillhub.cn/skills/user_103c9555/windows-performance-check before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.
Source and setup
skillhub.cn
Setup guidance pending
See the original source for supported tools, dependencies, and permissions.
Installation test pending
Windows system performance check tool. Used when you need to inspect CPU, memory, or disk I/O performance on a Windows server or generate a system health report. This skill collects data by running PowerShell scripts and produces an analysis report.
Introduction source: third_party · user_103c9555 · 1.0.0 Reference
SkillPi interpretation
- Tasks
- Translation pending; see source documentation.
- Testing
- Not tested
Browse files
Frontmatter
name: windows-system-performance-check
description: 当用户需要检查Windows服务器的CPU、内存或磁盘I/O性能,或生成一份系统健康状态报告时,使用此技能。它通过执行PowerShell脚本收集数据并输出分析报告。
tags: [运维, 监控, 自动化, 性能分析, Windows]Windows 系统性能检查专家
角色定位
你是一位资深的Windows系统运维专家,负责按需执行Windows服务器的健康检查。
触发条件
当用户提出以下需求时,应主动使用本技能:
- "帮我检查一下Windows服务器性能"
- "看看Windows的CPU和内存使用情况"
- "生成一份Windows系统运维报告"
- "Windows系统好像有点卡,检查一下"
工作流程
请直接在Windows系统上创建并运行以下名为 sys_perf_check.ps1 的PowerShell脚本。该脚本集成了数据采集、状态判断和报告输出三大功能,一次性完成全部检查工作。
完整脚本代码
# ============================================================
# Windows 系统性能检查脚本(全自动一体化版本)
# 功能:采集CPU/内存/磁盘数据 -> 判断状态 -> 输出完整报告
# ============================================================
Write-Host "=== Windows 系统性能检查报告 ===" -ForegroundColor Cyan
Write-Host "检查时间: $(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')"
Write-Host "主机名: $env:COMPUTERNAME"
Write-Host "操作系统: $(Get-CimInstance Win32_OperatingSystem).Caption"
# ==================== 第一步:采集数据 ====================
# 1. CPU 使用率
$cpu = Get-Counter '\Processor(_Total)\% Processor Time'
$cpuPercent = [math]::Round($cpu.CounterSamples.CookedValue, 2)
# 2. 内存使用情况
$os = Get-CimInstance Win32_OperatingSystem
$totalMem = [math]::Round($os.TotalVisibleMemorySize / 1MB, 2)
$freeMem = [math]::Round($os.FreePhysicalMemory / 1MB, 2)
$usedMem = [math]::Round($totalMem - $freeMem, 2)
$memPercent = [math]::Round(($usedMem / $totalMem) * 100, 2)
# 3. 磁盘空间
$disk = Get-CimInstance Win32_LogicalDisk -Filter "DeviceID='C:'"
$freeSpace = [math]::Round($disk.FreeSpace / 1GB, 2)
$totalSpace = [math]::Round($disk.Size / 1GB, 2)
$usedSpace = [math]::Round($totalSpace - $freeSpace, 2)
$diskPercent = [math]::Round(($usedSpace / $totalSpace) * 100, 2)
# 4. 磁盘 I/O
try {
$diskIO = Get-Counter '\PhysicalDisk(_Total)\Disk Reads/sec', '\PhysicalDisk(_Total)\Disk Writes/sec' -ErrorAction Stop
$readIO = [math]::Round($diskIO.CounterSamples[0].CookedValue, 2)
$writeIO = [math]::Round($diskIO.CounterSamples[1].CookedValue, 2)
} catch {
$readIO = "N/A(需管理员权限)"
$writeIO = "N/A(需管理员权限)"
}
# ==================== 第二步:判断状态 ====================
function Get-Status {
param($value, $warningThreshold, $dangerThreshold)
if ($value -lt $warningThreshold) { return "正常" }
elseif ($value -lt $dangerThreshold) { return "需要关注" }
else { return "危险" }
}
function Get-Suggestion {
param($status, $type)
if ($status -eq "正常") { return "无" }
if ($type -eq "cpu") {
if ($status -eq "需要关注") { return "检查CPU占用较高的进程" }
else { return "立即排查异常进程,考虑扩容" }
}
if ($type -eq "memory") {
if ($status -eq "需要关注") { return "检查内存泄漏,考虑增加物理内存" }
else { return "立即排查内存占用,紧急扩容" }
}
if ($type -eq "disk") {
if ($status -eq "需要关注") { return "清理临时文件,考虑扩展分区" }
else { return "立即清理空间,紧急扩容" }
}
}
$cpuStatus = Get-Status -value $cpuPercent -warningThreshold 70 -dangerThreshold 90
$memStatus = Get-Status -value $memPercent -warningThreshold 80 -dangerThreshold 95
$diskStatus = Get-Status -value $diskPercent -warningThreshold 80 -dangerThreshold 90
$cpuSuggestion = Get-Suggestion -status $cpuStatus -type "cpu"
$memSuggestion = Get-Suggestion -status $memStatus -type "memory"
$diskSuggestion = Get-Suggestion -status $diskStatus -type "disk"
# ==================== 第三步:输出报告 ====================
Write-Host "`n"
Write-Host "# Windows 系统性能检查报告" -ForegroundColor Cyan
Write-Host "**检查时间**:$(Get-Date -Format 'yyyy-MM-dd HH:mm:ss')`n"
# CPU 部分
Write-Host "## 1. CPU 性能" -ForegroundColor Yellow
Write-Host "- **占用率**:${cpuPercent}%"
Write-Host "- **状态**:$cpuStatus"
Write-Host "- **建议**:$cpuSuggestion"
# 内存部分
Write-Host "`n## 2. 内存性能" -ForegroundColor Yellow
Write-Host "- **总内存**:${totalMem}GB"
Write-Host "- **已用内存**:${usedMem}GB"
Write-Host "- **可用内存**:${freeMem}GB"
Write-Host "- **使用率**:${memPercent}%"
Write-Host "- **状态**:$memStatus"
Write-Host "- **建议**:$memSuggestion"
# 磁盘部分
Write-Host "`n## 3. 磁盘性能" -ForegroundColor Yellow
Write-Host "- **C盘总空间**:${totalSpace}GB"
Write-Host "- **C盘已用空间**:${usedSpace}GB"
Write-Host "- **C盘可用空间**:${freeSpace}GB"
Write-Host "- **C盘使用率**:${diskPercent}%"
Write-Host "- **磁盘读IOPS**:$readIO"
Write-Host "- **磁盘写IOPS**:$writeIO"
Write-Host "- **状态**:$diskStatus"
Write-Host "- **建议**:$diskSuggestion"
# 总结
Write-Host "`n## 总结" -ForegroundColor Green
if ($cpuStatus -eq "正常" -and $memStatus -eq "正常" -and $diskStatus -eq "正常") {
Write-Host "系统整体运行状态良好。" -ForegroundColor Green
} else {
$issueCount = 0
if ($cpuStatus -ne "正常") { $issueCount++ }
if ($memStatus -ne "正常") { $issueCount++ }
if ($diskStatus -ne "正常") { $issueCount++ }
Write-Host "系统存在 $issueCount 项需要关注的问题,请根据上述建议进行处理。" -ForegroundColor Yellow
}Current listing version
1.0.0
Quality assessment
Out of 100 · Assessment report from SkillPi LAB.
Highlights
- 面向Windows运维人员,解决实际性能监控需求
- 功能完整,涵盖CPU、内存、磁盘I/O等核心指标
Areas to improve
-
触发词可进一步补充 Reported severity: Minor
触发条件列举了主要查询语句,但缺少部分常见变体如'检查服务器状态'、'系统监控'等
Recommendation: 建议补充更多用户可能使用的查询变体,提升触发覆盖率
Highlights
- 触发条件覆盖合理,边界清晰
- 列举了多种用户可能提出的查询语句
Areas to improve
-
缺少When to Use章节 Reported severity: Minor
文档结构完整,但缺少明确的When to Use使用场景说明章节
Recommendation: 建议增加When to Use章节,明确说明适用场景和使用时机
Highlights
- Phase/步骤清晰,分为数据采集、状态判断、报告输出
- 有完整端到端示例,frontmatter完整
- 单文件未超过500行,结构良好
Areas to improve
-
缺少管理员权限前置检查说明 Reported severity: Minor
脚本中捕获了磁盘I/O获取失败的异常,但未在文档中明确说明需要管理员权限才能获取完整数据
Recommendation: 建议在文档中明确说明需要以管理员身份运行PowerShell才能获取完整的磁盘I/O数据
Highlights
- PowerShell脚本来源明确,参数正确
- 覆盖了主要异常(如磁盘I/O获取失败时捕获异常并提示需管理员权限)
- 无不可逆操作,执行安全可靠
The arithmetic mean of the first four original scores, rounded to a whole number.
Static text checks
100 / 100 · skillpi-20261123-no-r3-v1
No current rules matched the text.
This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.
Permissions and checks before use
Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.
-
Administrator or elevated privileges
Elevate only when necessary. Keep protection and certificate validation enabled and avoid broad system access.
Mentioned in main document · lines 61, 62
Security rating and access scope
safe · Static evidence review; not a runtime safety guarantee.
Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.
User discussion
No verified reviews yet.