Templates/New-ITIDocsSiteTemplate.ps1

<#
.SYNOPSIS
    Creates DocsSite repository structure according to the IT integro project template
 
.DESCRIPTION
    This function creates directories and source files for product docs site
 
.EXAMPLE
    New-ITIDocsSiteTemplate -ProductName YourProductName -ProductTradeName 'Your Product Trade Name' -Location ~/Desktop/MyProject
 
.NOTES
    The template includes:
    docfx.json - docfx configuration file
    index.md - home page source file
    toc.yml - table of contents source file
    .gitignore - gitignore for temp _site folder
    Product docs site directory - for storing product documentation articles
    Scripts directory - for storing build scripts and CI pipeline specification
#>

function New-ITIDocsSiteTemplate {
    [System.Diagnostics.CodeAnalysis.SuppressMessage('PSUseShouldProcessForStateChangingFunctions', '')]
    param (
        # Product name
        [Parameter(Mandatory=$true)]
        [string] $ProductName,
        # Product trade name
        [Parameter(Mandatory=$true)]
        [string] $ProductTradeName,     
        # Specifies the directory where the docs site template will be created
        [string] $Location = './'

    )
    if (-Not(Test-Path $Location)) {
        New-Item -Path $Location -ItemType Directory
    }
    Copy-DirectoryContent -SourceFolder (Join-Path $PSScriptRoot 'DocsSite') -Destination $Location
    Get-ChildItem $Location -File | 
    Foreach-Object {
        Update-FileContent -FilePath $_.FullName -SearchString 'ProductName' -RenameToString $ProductName
        Update-FileContent -FilePath $_.FullName -SearchString 'ProductTradeName' -RenameToString $ProductTradeName
    }
    Rename-Item (Join-path $Location 'ApplicationDocs') $ProductName
}

Export-ModuleMember -Function New-ITIDocsSiteTemplate