One of the key goals of the PowerShell App Deployment Toolkit is to provide a consistent set of core functions that can be reused when deploying applications. It’s very likely however, that you will have additional functions that you would like to reuse. It’s easy to create your own functions and extend the toolkit without any modification to the core toolkit itself - which makes updating to new versions quick and painless.
To add an extension to the toolkit, add the function to the body of PSAppDepoyToolkitExtensions.ps1.
Please post properly formatted code to the discussion forums by either using the “crayon” button in the editor or surrounding your code with the pre tag.
https://codex.wordpress.org/Writing_Code_in_Your_Posts
To help you get started, we have included a template for creating a function in the same style as those included in the toolkit:
## Microsoft Function Naming Convention: http://msdn.microsoft.com/en-us/library/ms714428(v=vs.85).aspx
Function Verb-Noun {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER
.EXAMPLE
.NOTES
.LINK
http://psappdeploytoolkit.com
#>
[CmdletBinding()]
Param (
)
Begin {
## Get the name of this function and write header
[string]${CmdletName} = $PSCmdlet.MyInvocation.MyCommand.Name
Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -CmdletBoundParameters $PSBoundParameters -Header
}
Process {
Try {
}
Catch {
Write-Log -Message "<error message>. `n$(Resolve-Error)" -Severity 3 -Source ${CmdletName}
}
}
End {
Write-FunctionHeaderOrFooter -CmdletName ${CmdletName} -Footer
}
}