powershell-new-module
Skill24 starsChanged 4 days agoMITView on GitHub
Create a new PowerShell module with a manifest, a root module, Public and Private folders, a first function, and Pester tests, following this repository's PowerShell standards. Use when asked to create, scaffold, or start a PowerShell module.
In this repository33 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .claude/rules/powershell-standards/copilot-instructions.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- powershell-ci-pipelineSkill
- powershell-credential-scanSkill
- powershell-loggingSkill
- powershell-module-helpSkill
- powershell-new-functionSkill
- powershell-new-moduleSkill
- powershell-performance-reviewSkill
- powershell-reviewSkill
- powershell-security-reviewSkill
- powershell-write-testsSkill
- powershell-ci-pipelineSkill
- powershell-credential-scanSkill
- powershell-loggingSkill
- powershell-module-helpSkill
- powershell-new-functionSkill
- powershell-new-moduleSkill
- powershell-performance-reviewSkill
- powershell-reviewSkill
- powershell-security-reviewSkill
- powershell-write-testsSkill
- powershell-ci-pipelineSkill
- powershell-credential-scanSkill
- powershell-loggingSkill
- powershell-module-helpSkill
- powershell-new-functionSkill
- powershell-performance-reviewSkill
- powershell-reviewSkill
- powershell-security-reviewSkill
- powershell-write-testsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 2 are distinctive, and 6 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈2
Distinctive · estimate
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Read these before writing files, unless they are already loaded:
- Distinctive: line 17
Ask for, or confirm, the module name, what it is for, and whether it must run on Windows PowerShell 5.1.
- Very specific: line 19
Create the layout from the module rules: ModuleName.psd1, ModuleName.psm1, Public/, Private/, and Tests/, with the unit tests under …
- Very specific: line 23
Write the manifest with literal values only.
- Very specific: line 28
Write the root module exactly as the module rules show it: a #Requires -Version line that matches the manifest's PowerShellVersion …
- Very specific: line 31
Add the first function with the powershell-new-function skill, or follow its steps.
- Very specific: line 32
Import the module in a new session with Import-Module ./ModuleName.psd1 -Force, confirm that Get-Command -Module ModuleName lists exactly …
- Very specific: line 34
Add a README.md that follows .github/instructions/powershell-readme.instructions.md.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Create a new PowerShell module
Read these before writing files, unless they are already loaded:
.github/copilot-instructions.md, orAGENTS.mdif the repository has no such file (the core rules and the function template).github/instructions/powershell-modules.instructions.md.github/instructions/powershell-version.instructions.md
Steps
- Ask for, or confirm, the module name, what it is for, and whether it must run on Windows PowerShell 5.1. Without a 5.1 requirement, target PowerShell 7.6.
- Create the layout from the module rules:
ModuleName.psd1,ModuleName.psm1,Public/,Private/, andTests/, with the unit tests underTests/Unit/(MOD-01). AddTests/Integration/andTests/Performance/when the module has such tests, andClasses/only if the module defines a class. Do not create empty folders for things the module does not have. - Write the manifest with literal values only. Generate the GUID once with
New-Guidand paste the result. SetPowerShellVersionandCompatiblePSEditionsfor the target. List exported functions by name. TakeAuthor,CompanyName, and the copyright holder from.github/powershell-attribution.mdwhen the project has one (DOC-18), and the project links from the user or the repository; leave out what you do not know. - Write the root module exactly as the module rules show it: a
#Requires -Versionline that matches the manifest'sPowerShellVersion(MOD-08), strict mode, thenClasses,Private, andPublicdot-sourced in that order, failing the import if a file fails to load. - Add the first function with the
powershell-new-functionskill, or follow its steps. - Import the module in a new session with
Import-Module ./ModuleName.psd1 -Force, confirm thatGet-Command -Module ModuleNamelists exactly the exported functions, and run the tests. - Add a
README.mdthat follows.github/instructions/powershell-readme.instructions.md.
Report
List the files you created, the target version, and the results of the import check and the tests. Do
not add dependencies or CI workflows unless the user asked for them; mention them as possible next
steps instead. Every module generates its command help with PlatyPS (PLT-10): do that with the
powershell-module-help skill, or say that it is still to do.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

