powershell-7-expert
LinuxやmacOSを含むクロスプラットフォーム環境で、PowerShell 7を用いた高度な自動化スクリプトを開発・実行するSkill。
📜 元の英語説明(参考)
Expert in modern, cross-platform PowerShell Core. Specializes in Linux/macOS automation, parallel processing, REST API integration, and modern scripting patterns. Use for cross-platform automation and modern PowerShell features. Triggers include "PowerShell 7", "PowerShell Core", "pwsh", "ForEach-Object -Parallel", "cross-platform PowerShell".
🇯🇵 日本人クリエイター向け解説
LinuxやmacOSを含むクロスプラットフォーム環境で、PowerShell 7を用いた高度な自動化スクリプトを開発・実行するSkill。
※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。
⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。
🎯 このSkillでできること
下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。
📦 インストール方法 (3ステップ)
- 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
- 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
- 3. 展開してできたフォルダを、ホームフォルダの
.claude/skills/に置く- · macOS / Linux:
~/.claude/skills/ - · Windows:
%USERPROFILE%\.claude\skills\
- · macOS / Linux:
Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。
詳しい使い方ガイドを見る →- 最終更新
- 2026-05-17
- 取得日時
- 2026-05-17
- 同梱ファイル
- 1
📖 Skill本文(日本語訳)
※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。
PowerShell 7 エキスパート
目的
クロスプラットフォームの自動化のために、最新の PowerShell 7+ (PowerShell Core) に関する専門知識を提供します。並列処理、REST API 統合、最新のスクリプトパターン、および新しい言語機能の活用を専門としています。
使用場面
- クロスプラットフォームの自動化 (Windows、Linux、macOS)
- ForEach-Object -Parallel を使用した並列処理
- REST API 統合
- 最新の PowerShell スクリプトパターン
- パイプラインチェーン演算子 (&& ||)
- 三項演算子と null 合体演算子
- SSH ベースのリモート処理
- JSON/YAML データ操作
クイックスタート
このスキルを呼び出すのは、以下の場合です。
- クロスプラットフォームの PowerShell スクリプトを作成する場合
- PowerShell 7+ 固有の機能を使用する場合
- 並列処理を実装する場合
- REST API 統合を構築する場合
- 5.1 からスクリプトを最新化する場合
このスキルを呼び出さないのは、以下の場合です。
- レガシーな Windows 専用システム →
/powershell-5.1-expertを使用してください - GUI 開発 →
/powershell-ui-architectを使用してください - セキュリティ設定 →
/powershell-security-hardeningを使用してください - モジュール設計 →
/powershell-module-architectを使用してください
決定フレームワーク
PowerShell 7 Feature Selection?
├── Parallel Processing
│ ├── Simple iteration → ForEach-Object -Parallel
│ └── Complex workflows → Start-ThreadJob
├── API Integration
│ └── Invoke-RestMethod with modern options
├── Null Handling
│ ├── Default value → ?? operator
│ └── Conditional access → ?. operator
└── Pipeline Control
└── && and || chain operators
コアワークフロー
1. 並列処理
- 並列化可能なワークロードを特定します
- ForEach-Object -Parallel を使用します
- -ThrottleLimit を適切に設定します
- スレッドセーフなデータアクセスを処理します
- 結果を集約します
- 並列実行からのエラーを処理します
2. REST API 統合
- リクエストパラメータを構築します
- 認証 (Bearer、OAuth) を処理します
- Invoke-RestMethod を使用します
- JSON レスポンスを解析します
- ページネーションを実装します
- 失敗時の再試行ロジックを追加します
3. クロスプラットフォームスクリプト
- Windows 固有のパスを避けます
- $PSVersionTable と $IsLinux/$IsWindows を使用します
- パス区切り文字を正しく処理します
- すべてのターゲットプラットフォームでテストします
- 互換性のあるモジュールを使用します
- プラットフォーム要件を文書化します
ベストプラクティス
- 簡潔な条件式には三項演算子を使用します
- デフォルト値には null 合体演算子を活用します
- CPU バウンドなタスクには ForEach-Object -Parallel を使用します
- クロスプラットフォームでは WinRM よりも SSH リモート処理を優先します
- クロスプラットフォームのパスには Join-Path を使用します
- すべてのターゲットオペレーティングシステムでテストします
アンチパターン
| アンチパターン | 問題点 | 正しいアプローチ |
|---|---|---|
| ハードコードされたバックスラッシュ | Linux/macOS で動作しない | Join-Path または / |
| Windows 専用のコマンドレット | クロスプラットフォームで失敗する | 利用可能性を確認する |
| 過剰な並列化 | スレッドのオーバーヘッド | ThrottleLimit を調整する |
| $Error の無視 | サイレントな失敗 | 適切なエラー処理 |
| WinRM の前提 | クロスプラットフォームではない | SSH リモート処理 |
📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開
PowerShell 7 Expert
Purpose
Provides expertise in modern PowerShell 7+ (PowerShell Core) for cross-platform automation. Specializes in parallel processing, REST API integration, modern scripting patterns, and leveraging new language features.
When to Use
- Cross-platform automation (Windows, Linux, macOS)
- Parallel processing with ForEach-Object -Parallel
- REST API integrations
- Modern PowerShell scripting patterns
- Pipeline chain operators (&& ||)
- Ternary expressions and null coalescing
- SSH-based remoting
- JSON/YAML data manipulation
Quick Start
Invoke this skill when:
- Writing cross-platform PowerShell scripts
- Using PowerShell 7+ specific features
- Implementing parallel processing
- Building REST API integrations
- Modernizing scripts from 5.1
Do NOT invoke when:
- Legacy Windows-only systems → use
/powershell-5.1-expert - GUI development → use
/powershell-ui-architect - Security configuration → use
/powershell-security-hardening - Module design → use
/powershell-module-architect
Decision Framework
PowerShell 7 Feature Selection?
├── Parallel Processing
│ ├── Simple iteration → ForEach-Object -Parallel
│ └── Complex workflows → Start-ThreadJob
├── API Integration
│ └── Invoke-RestMethod with modern options
├── Null Handling
│ ├── Default value → ?? operator
│ └── Conditional access → ?. operator
└── Pipeline Control
└── && and || chain operators
Core Workflows
1. Parallel Processing
- Identify parallelizable workload
- Use ForEach-Object -Parallel
- Set -ThrottleLimit appropriately
- Handle thread-safe data access
- Aggregate results
- Handle errors from parallel runs
2. REST API Integration
- Construct request parameters
- Handle authentication (Bearer, OAuth)
- Use Invoke-RestMethod
- Parse JSON response
- Implement pagination
- Add retry logic for failures
3. Cross-Platform Script
- Avoid Windows-specific paths
- Use $PSVersionTable and $IsLinux/$IsWindows
- Handle path separators correctly
- Test on all target platforms
- Use compatible modules
- Document platform requirements
Best Practices
- Use ternary operator for concise conditionals
- Leverage null-coalescing for defaults
- Use ForEach-Object -Parallel for CPU-bound tasks
- Prefer SSH remoting over WinRM for cross-platform
- Use Join-Path for cross-platform paths
- Test on all target operating systems
Anti-Patterns
| Anti-Pattern | Problem | Correct Approach |
|---|---|---|
| Hardcoded backslashes | Breaks on Linux/macOS | Join-Path or / |
| Windows-only cmdlets | Cross-platform failure | Check availability |
| Over-parallelization | Thread overhead | Tune ThrottleLimit |
| Ignoring $Error | Silent failures | Proper error handling |
| Assuming WinRM | Not cross-platform | SSH remoting |