PSModule.psm1
function New-PSModule { <# .Synopsis Creates a new, basic framework for a PowerShell module. .Parameter Name The name of the new module skeleton that you want to create. .Example ### Create a new module skeleton New-PSModule -Name Twitter #> [CmdletBinding()] param ( [Parameter(Mandatory = $true)] [string] $Name ) $ModuleDir = 'Documents\WindowsPowerShell\Modules'; $Module = @{ Folder = '{0}\{1}\{2}' -f $env:UserProfile, $ModuleDir, $Name; Manifest = '{0}\{1}\{2}\{2}.psd1' -f $env:UserProfile, $ModuleDir, $Name; File = '{0}\{1}\{2}\{2}.psm1' -f $env:UserProfile, $ModuleDir, $Name; } if (!(Test-Path -Path $Module.Folder)) { mkdir -Path $Module.Folder; } New-ModuleManifest -Path $Module.Manifest -RootModule (Split-Path -Path $Module.File -Leaf); Set-Content -Path $Module.File -Value ''; } |