Scripts/Set-ProjectNameForTemplate.ps1

function Set-ProjectNameForTemplate {
    [CmdletBinding()]
    Param(
        [string] [Parameter(Mandatory = $true)] $ProjectName,
        [string] [Parameter(Mandatory = $true)] $ProjectPath,
        [string] [Parameter(Mandatory = $true)] $Email,
        [string] [Parameter(Mandatory = $false)] $Name
    )

    try {
        $global:devops_gitRepo = $ProjectName
        $global:devops_projectLocation = "$ProjectPath\Source"   
        Set-Location -Path "$global:devops_projectLocation" 
        ls     
        Write-Host $global:devops_projectLocation
        Write-Host $ProjectPath
        Write-Host $ProjectName       
        Write-Host "Email - "  $Email
        if ((Test-Path -Path "$global:devops_projectLocation")) {
            Set-Location -Path "$global:devops_projectLocation" 

            $message = "Setting up PowerPlatform.DevOps Project"
            Write-Host $message

            Write-Host "Rename PowerPlatformDevOps.sln to $global:devops_gitRepo.sln"
            Rename-Item -Path $global:devops_projectLocation\PowerPlatformDevOps.sln -NewName "$global:devops_gitRepo.sln"

            Write-Host "Rename dot files"
            Rename-Item -Path $global:devops_projectLocation\file.gitignore -NewName ".gitignore"
            Rename-Item -Path $global:devops_projectLocation\file.artifactignore -NewName ".artifactignore"
            Rename-Item -Path $global:devops_projectLocation\file.gitattributes -NewName ".gitattributes"
            Rename-Item -Path $global:devops_projectLocation\SolutionTemplate\file.eslintrc.json -NewName ".eslintrc.json"
            Rename-Item -Path $global:devops_projectLocation\SolutionTemplate\file.prettierrc.json -NewName ".prettierrc.json"

            git add -A 
            git commit -m "Set Project Name to $global:devops_gitRepo"
        }
    }
    catch {
        Write-Host "Error: $_"
    }
}