Main | Contact | Blog | Documentation

PowerShell Framework

The project dedicated to empowering your PowerShell scripting.

Getting Started with Template Creation

In order to create a new template from a file, you first need to have a file. For example, let us create a new function template.

The file we template should be named þnameþ.ps1 (That way it will automatically name the file for the function)

The file could look like this (but really, you can insert whatever meets your needs):

function þnameþ
{
	[CmdletBinding()]
	Param (
	
	)
	
	begin
	{
		
	}
	process
	{
	
	}
	end
	{
	
	}
}

Now that we have a file we want to make a template of, run this command to create it:

New-PSMDTemplate -FilePath ".\þnameþ.ps1" -TemplateName myFunction -Description "My first function template" -Author "<Insert your name here>" -Tags 'function','file'

This is all that it takes, you now can create files based on this template using Invoke-PSMDTemplate (or its alias imt).

Additional information

Further reading