Created
June 23, 2017 08:36
-
-
Save CosmosKey/525afd61d75fbe400bfb5f0b50f25cfd to your computer and use it in GitHub Desktop.
Sample module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$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