OpsaC - Operating as PowerShell code
published: September 6, 2019 author: Tinu tags: PowerShell categories: PowerShell-Module
How to create a new PowerShell-Module with PSModuleTemplate?
Information about your project.
Update this file whenever you make changes on your module!
This is the folder for all Continous Integration scripts like a script to automate the Module-File (Build-Module.ps1) and other scripts.
This script builds your module automatically.
Build-Module.ps1 running the Functions.Tests.ps1, if no errors occured it delete the existent Module-File (PSM1) and create a new Module-File (PSM1) with all of your functions. The script also updates the Manifest-File (PSD1) with the functions to export. If the Manifest-File doesn’t exists, it will be created.
Finally Build-Module.ps1 tests if your Module can be imported and removed without any errors. It tests also if the Module contains all of your exported functions.
The settings-file will be created, if you build the module at the first time and contains the following properties:
ModuleName
ModuleVersion
ModuleDescription
ModuleAuthor
ModuleCompany
In this folder save all your functions as PS1-Files with the Name of the function you want to have in the Module. e.g. Get-SCSSomeSettings.ps1.
This is an example function-file, you can copy and rename this file for your own use. Before you build your module, please delete the Get-SCSSomeSettings.ps1.
The Module-Folder will be created automatically with the Build-Module.script.
Automatically generated Manifest-file (PSD1), please update some settings by editing the file in vs-code.
PowerShell-Module-file (PSM1), contains all your functions from the Code-folder.
This folder contains all the Pester-Test-scripts.
Functions.Tests.ps1 tests all of your scripts/functions in the folder Code.
This file will be created, if there were some errors in the Build-Module.