Skip to content

Instantly share code, notes, and snippets.

@deangrant
Last active October 3, 2015 12:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deangrant/6a62a875e920148f20b7 to your computer and use it in GitHub Desktop.
Save deangrant/6a62a875e920148f20b7 to your computer and use it in GitHub Desktop.
Snippet for Create-ModuleStructure script
[CmdletBinding()]
Param (
[String]
$ModuleName = "TestModule",
[String]
$Author = "",
[String]
[ValidateScript({Get-Item $_ })]
$Path = "C:\Sandbox\PowerShell\Modules"
)
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName) -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\Private") -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\Public") -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\en-US") -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\lib") -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\bin") -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\Tests") -Type Directory | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\" + $ModuleName + ".psm1") -Type File | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\" + $ModuleName + ".Format.ps1.xml") -Type File | Out-Null
New-Item ($Path + "\" + $ModuleName + "\" + $ModuleName + "\en-US\about_$ModuleName.help.txt") -Type File | Out-Null
New-Item ($Path + "\" + $ModuleName + "\Tests\" + $ModuleName + ".Tests.ps1") -Type File | Out-Null
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment