Templates/New-ITIApplicationTemplate.ps1
<#
.SYNOPSIS Creates empty project structure according to the IT integro project template .DESCRIPTION This function creates directories for source code files, build scripts and automated tests, README and INSTRUCTION files according to the IT intego project template .EXAMPLE New-ITIApplicationTemplate -Location ~/Desktop/MyProject .NOTES The template includes: README.md file Apps directory - for storing application source files Tests directory - for storing automated tests Scripts directory - for storing build scripts and CI pipeline specification .gitignore - gitignore for C/AL and AL development #> function New-ITIApplicationTemplate { [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')] param ( # Specifies the directory where the project will be created [string] $Location = './', # Specifies the type of application template to use [Parameter(Mandatory)] [ValidateSet('cal','al')] [string] $ApplicationType ) if (-Not(Test-Path $Location)) { New-Item -Path $Location -ItemType Directory } switch ($ApplicationType) { 'cal' { $TemplateLocation = 'Application/Application (CSide)' } 'al' { $TemplateLocation = 'Application/Application (AL)' } } Copy-DirectoryContent -SourceFolder (Join-Path $PSScriptRoot $TemplateLocation) -Destination $Location } Export-ModuleMember -Function New-ITIApplicationTemplate |