### Install ModuleBuilder Templates Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/README.md Installs the ModuleBuilder templates from a local directory. Ensure the dotnet SDK is installed. ```powershell dotnet new -i "./" ``` -------------------------------- ### Configure Script Generators in build.psd1 Source: https://github.com/poshcode/modulebuilder/blob/main/ReadMe.md This example shows how to pass generator configurations to Build-Module in a module's build.psd1 file. It specifies the generator type, the target function, and a GUID. ```PowerShell Generators = @( @{ Generator = "ConvertTo-Script"; Function = "Install-FromGitHub"; GUID = '23addf96-d1d7-4f51-b97f-c4f0189263b6' } ) ``` -------------------------------- ### Install Required Module Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/Dotnet/ModuleBuilderModule/README.md Installs the necessary ModuleBuilder module. This is a prerequisite for building your own module. ```powershell Install-Script -Name Install-RequiredModule ``` -------------------------------- ### Install ModuleBuilder Templates with Alias Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/README.md Installs the PSModuleBuilder template using a short alias 'psmo' and sets default author and company. ```powershell dotnet new -a psmo psmodulebuilder --author Jaykul --company PoshCode.org ``` -------------------------------- ### Build and Test ModuleBuilder without Earthbuild Source: https://github.com/poshcode/modulebuilder/blob/main/ReadMe.md Navigate to the ModuleBuilder directory after cloning and run the build script to install dependencies, build, and test the module. ```powershell cd ModuleBuilder ./build.build.ps1 ``` -------------------------------- ### Build and Test with Earthbuild Source: https://github.com/poshcode/modulebuilder/blob/main/ReadMe.md Use this command to clone the repository, navigate to the directory, and run the build and test process using Earthbuild. ```powershell git clone https://github.com/PoshCode/ModuleBuilder.git cd ModuleBuilder earth +test ``` -------------------------------- ### Build a Versioned Module with ModuleBuilder Source: https://github.com/poshcode/modulebuilder/blob/main/Source/en-US/about_ModuleBuilder.help.txt This command initiates the module build process, creating a versioned output folder with an updated manifest and a consolidated PSM1 file containing all public and private functions. ```powershell Build-Module -SourcePath .\ModuleBuilder\Source\build.psd1 ``` -------------------------------- ### Generate New Module with Custom Options Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/README.md Generates a new module folder with specified output directory, author, company, and description. ```powershell dotnet new PSModuleBuilder -o MyNewModule --author Jaykul --company PoshCode.org --description "My Brand New Module" ``` -------------------------------- ### Generate New Module Using Alias with Defaults Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/README.md Creates a new module using the 'psmo' alias, specifying the output directory and description. Author and company are pre-configured. ```powershell dotnet new psmo -o MyNewModule --description "My Brand New Module" ``` -------------------------------- ### Generate New Module with Default Settings Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/README.md Creates a new PowerShell module in the current directory using the PSModuleBuilder template. ```powershell dotnet new PSModuleBuilder ``` -------------------------------- ### Clone ModuleBuilder and Tasks Repositories Source: https://github.com/poshcode/modulebuilder/blob/main/ReadMe.md Clone both the ModuleBuilder and Tasks repositories. Ensure the Tasks folder is a sibling to the ModuleBuilder folder for the build script to function correctly. ```powershell git clone https://github.com/PoshCode/ModuleBuilder.git git clone https://github.com/PoshCode/Tasks.git ``` -------------------------------- ### Build Module from Source Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/Dotnet/ModuleBuilderModule/README.md Compiles a PowerShell module from script files located in the 'Source' folder. The compiled module will be placed in the 'Output' folder. ```powershell Build-Module .\Source ``` -------------------------------- ### Build Module with Specific Version Source: https://github.com/poshcode/modulebuilder/blob/main/Templates/Dotnet/ModuleBuilderModule/README.md Compiles a PowerShell module and manually sets the semantic version. Use this to override automatic versioning or set an initial version. ```powershell Build-Module .\Source -SemVer 0.0.2 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.