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 = './'
    )
    if (-Not(Test-Path $Location)) {
        New-Item -Path $Location -ItemType Directory
    }
    $RootDirectories.ForEach({
        $path = Join-Path $Location -ChildPath $_
        New-Item -Path $path -ItemType Directory
    })
    $AppsInstructionContents > (Join-Path $Location 'Apps/INSTRUCTIONS.md')
    $ScriptsInstructionContents > (Join-Path $Location 'Scripts/INSTRUCTIONS.md')
    $TestsInstructionContents > (Join-Path $Location 'Tests/INSTRUCTIONS.md')
    $ReadmeContents > (Join-Path $Location 'README.md')
    $GitignoreContents > (Join-Path $Location '.gitignore')
}
Export-ModuleMember -Function New-ITIApplicationTemplate