Templates/DocsSite/Test.txt

1. ProductName
2. ProductTradeName
 
3. ProductName
4. ProductTradeName
 
 
 
<#
.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 -Location ~/Desktop/MyProject -ProductName YourProductName -ProductTradeName 'Your Product Trade Name'
 
.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 {
    [CmdletBinding()]
    [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
    }
    New-Item -Path (Join-Path $Location $ProductName)
    # New-Item -Path ($Location + 'includes')
    # New-Item -Path ($Location + 'media')
    # replace bellow with function CreateFromTemplate('Template file path','TargetFilePath',$ProductName,$ProductTradeName)
    ((Get-Content -path ($PSScriptRoot + '\docfx.json')) -replace 'ProductName', $ProductName) | Set-Content -Path ($Location + '\docfx.json')
    ((Get-Content -path ($PSScriptRoot + '\index.md')) -replace 'ProductName', $ProductName -replace 'ProductTradeName', $ProductTradeName) | Set-Content -Path ($Location + '\index.md')
    ((Get-Content -path ($PSScriptRoot + '\toc.yml')) -replace 'ProductName', $ProductName -replace 'ProductTradeName', $ProductTradeName) | Set-Content -Path ($Location + '\toc.yml')
    ((Get-Content -path ($PSScriptRoot + '\.gitmodules')) -replace 'ProductName', $ProductName) | Set-Content -Path ($Location + '\.gitmodules')
    ((Get-Content -path ($PSScriptRoot + '\.gitignore')) -replace 'ProductName', $ProductName) | Set-Content -Path ($Location + '\.gitignore')
    # add files for includes and media
}
Export-ModuleMember -Function New-ITIDocsSiteTemplate