Token导航 LogoToken导航TokenDH.com
研究检索操作浏览器github未标认证来源可访问clear审计提醒

powershell-expertpowershell 专家

Agent Skill

powershell-expert 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

696

周安装

29

GitHub Stars

23

下载量

232
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

3

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:powershell-expert(powershell 专家)
来源仓库:https://github.com/hmohamed01/powershell-expert
仓库路径:skills/powershell-expert
安装命令:
npx skills add https://github.com/hmohamed01/powershell-expert --skill powershell-expert
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。不同来源提供的安装方式可能略有差异;本站展示可直接复制的安装命令,安装前请核对来源页面。

skills.shnpx skills
npx skills add https://github.com/hmohamed01/powershell-expert --skill powershell-expert

简介

powershell-expert 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中快速定位候选结果。

  • 适用于关键词驱动的信息检索和任务场景匹配。
  • 通过 npx skills add 命令从 GitHub 仓库安装并使用。
  • 安装前需确认权限范围、项目维护状态及是否触发联网或文件读写操作。
  • 建议结合原始 README 文档核验具体功能和使用限制。

SKILL.md

PowerShell Expert

Develop production-quality PowerShell scripts, tools, and GUIs using Microsoft best practices and the PowerShell ecosystem.

Quick Reference

Script Structure

#Requires -Version 5.1

<#
.SYNOPSIS
    Brief description.
.DESCRIPTION
    Detailed description.
.PARAMETER Name
    Parameter description.
.EXAMPLE
    Example-Usage -Name 'Value'
#>

[CmdletBinding()]
param(
    [Parameter(Mandatory, ValueFromPipeline)]
    [ValidateNotNullOrEmpty()]
    [string[]]$Name,

    [switch]$Force
)

begin {
    # One-time setup
}

process {
    foreach ($item in $Name) {
        # Per-item processing
    }
}

end {
    # Cleanup
}

Function Template

function Verb-Noun {
    [CmdletBinding(SupportsShouldProcess)]
    param(
        [Parameter(Mandatory, Position = 0)]
        [string]$Name,

        [Parameter(ValueFromPipelineByPropertyName)]
        [Alias('CN')]
        [string]$ComputerName = $env:COMPUTERNAME,

        [switch]$PassThru
    )

    process {
        if ($PSCmdlet.ShouldProcess($Name, 'Action')) {
            # Implementation
            if ($PassThru) { Write-Output $result }
        }
    }
}

Workflow

1. Script Development

Follow naming and parameter conventions:

  • Verb-Noun format with approved verbs (Get-Verb)
  • Strong typing with validation attributes
  • Pipeline support via ValueFromPipeline
  • -WhatIf/-Confirm for destructive operations

See best-practices.md for complete guidelines.

2. GUI Development

Windows Forms for simple dialogs, WPF/XAML for complex interfaces:

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

$form = New-Object System.Windows.Forms.Form -Property @{
    Text          = 'Title'
    Size          = New-Object System.Drawing.Size(400, 300)
    StartPosition = 'CenterScreen'
}

See gui-development.md for controls, events, and templates.

3. PowerShell Gallery Integration

Search and install modules using PSResourceGet:

# Search gallery
Find-PSResource -Name 'ModuleName' -Repository PSGallery

# Install module
Install-PSResource -Name 'ModuleName' -Scope CurrentUser -TrustRepository

Use scripts/Search-Gallery.ps1 for enhanced search.

See powershellget.md for full cmdlet reference.

Key Patterns

Error Handling

try {
    $result = Get-Content -Path $Path -ErrorAction Stop
}
catch [System.IO.FileNotFoundException] {
    Write-Error "File not found: $Path"
    return
}
catch {
    throw
}

Splatting for Readability

$params = @{
    Path        = $sourcePath
    Destination = $destPath
    Recurse     = $true
    Force       = $true
}
Copy-Item @params

Pipeline Best Practices

# Stream output immediately
foreach ($item in $collection) {
    Process-Item $item | Write-Output
}

# Accept pipeline input
param(
    [Parameter(ValueFromPipeline)]
    [string[]]$InputObject
)
process {
    foreach ($obj in $InputObject) {
        # Process each
    }
}

Module Recommendations

When recommending modules, search the PowerShell Gallery. These are common starting points — always verify via the Live Verification workflow before recommending:

CategoryPopular Modules
AzureAz, Az.Compute, Az.Storage
TestingPester, PSScriptAnalyzer
ConsolePSReadLine, Terminal-Icons
SecretsMicrosoft.PowerShell.SecretManagement
WebPode (web server), PoshRSJob (async)
GUIWPFBot3000, PSGUI

Live Verification

You MUST verify information against live sources when accuracy is critical. Do not rely solely on training data for module availability or cmdlet syntax.

Tools to use:

  • WebFetch: Retrieve and parse specific documentation URLs (PowerShell Gallery pages, Microsoft Docs)
  • WebSearch: Find correct URLs when the exact path is unknown or to verify module existence

When Verification is Required

ScenarioAction
User asks "does module X exist?"MUST verify via PowerShell Gallery
Recommending a specific moduleMUST verify it exists and isn't deprecated
Providing exact cmdlet syntaxSHOULD verify against Microsoft Docs
Module version requirementsMUST check gallery for current version
General best practicesStatic references are sufficient

Step 1: Verify Module on PowerShell Gallery

When recommending or checking a module, use the WebFetch tool to verify it exists:

WebFetch call:

  • URL: https://www.powershellgallery.com/packages/{ModuleName}
  • Prompt: Extract: module name, latest version, last updated date, total downloads, and whether it shows any deprecation warning or 'unlisted' status

If WebFetch returns 404 or error: The module likely doesn't exist. Use the WebSearch tool to confirm:

  • Query: {ModuleName} PowerShell module site:powershellgallery.com

Step 2: Verify Cmdlet Syntax (When Needed)

Microsoft Docs URLs vary by module. Use the WebSearch tool to find the correct documentation page:

WebSearch call:

  • Query: {Cmdlet-Name} cmdlet site:learn.microsoft.com/en-us/powershell

Then use WebFetch on the returned URL with prompt:

  • Prompt: Extract the complete cmdlet syntax, required vs optional parameters, and PowerShell version requirements

For PSResourceGet cmdlets specifically, fetch the raw markdown directly:

  • URL: https://raw.githubusercontent.com/MicrosoftDocs/powershell-docs-psget/live/powershell-gallery/powershellget-3.x/Microsoft.PowerShell.PSResourceGet/{Cmdlet-Name}.md
  • Prompt: Extract the complete cmdlet syntax, required vs optional parameters, and examples

Step 3: Fallback Strategies

If the WebFetch or WebSearch tools are unavailable or return errors:

  1. For module verification: Execute Search-Gallery.ps1 from this skill: ~/.claude/skills/powershell-expert/scripts/Search-Gallery.ps1 -Name 'ModuleName'
  2. For cmdlet syntax: Suggest the user run locally: Get-Help Cmdlet-Name -Full Get-Command Cmdlet-Name -Syntax
  3. Clearly state uncertainty: If verification fails, tell the user: "I wasn't able to verify this against live documentation. Please confirm the module exists by running: Find-PSResource -Name 'ModuleName'"

Verification Examples

Good (verified with live data):

"The ImportExcel module (v7.8.10, updated Oct 2024, 17M+ downloads) provides Export-Excel for creating spreadsheets without Excel installed."

Bad (unverified claim):

"Use the Excel-Tools module to export data." ← May not exist!

Documentation Resources

References

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

能力 5

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Antigravity

26.77%
按下载量换算62

Claude Code

21.86%
按下载量换算51

OpenCode

18.64%
按下载量换算43

Gemini CLI

14.23%
按下载量换算33

windsurf

8.86%
按下载量换算21

Codex

3.61%
按下载量换算8

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

可疑

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。

来源信息

继续浏览同类 Skills