Skip to content

Instantly share code, notes, and snippets.

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 CosmosKey/525afd61d75fbe400bfb5f0b50f25cfd to your computer and use it in GitHub Desktop.
Save CosmosKey/525afd61d75fbe400bfb5f0b50f25cfd to your computer and use it in GitHub Desktop.
Sample module
$ModuleName = "MyTestModule"
$userModulePath = $env:PSModulePath.Split(";") -like "*\$env:USERNAME\*"
New-Item -Path "$userModulePath\$ModuleName" -ItemType Directory -Force | Out-Null
{function Get-Zero{0}function Get-One{1}}|Set-Content "$userModulePath\$ModuleName\$ModuleName.psm1"
New-ModuleManifest -Path "$userModulePath\$ModuleName\$ModuleName.psd1" -RootModule "$ModuleName.psm1" -FunctionsToExport "Get-Zero"
Get-Module -ListAvailable -Name $ModuleName
Get-Zero
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment