Private/Cs/WebProj/New-AppSettings.ps1

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Function New-AppSettings([SolnInfo]$solnInfo, [WebCsprojInfo]$webCsprojInfo, [DbInfo]$dbInfo) { 
    # Need an AppSettings object
    Write-Host "### Create" $webCsprojInfo.csprojName "AppSettings.cs"
    New-AppSettingsCsToString $webCsprojInfo.csprojName | Set-Content "$($webCsprojInfo.csprojDir)\AppSettings.cs"

    # appSettings.json
    Write-Host "### Create $($webCsprojInfo.csprojName)\appSettings.json"
    New-AppSettingsJsonToString $webCsprojInfo.csprojDir | Set-Content "$($webCsprojInfo.csprojDir)\appSettings.json"
        
    # appDevelopmentSettings.json
    Write-Host "### Create $($webCsprojInfo.csprojName)\appSettings.development.json"
    New-AppSettingsDevelopmentJsonToString $solnInfo $dbInfo | Set-Content "$($webCsprojInfo.csprojDir)\appSettings.development.json" 

    # Scaffolded Startup.cs needs major rewrite
    #Write-Host "### Fixing $($webCsprojInfo.csprojDir)\Startup.cs"
    #CreateStartupCs $nickName $webCsprojInfo.csprojName | Set-Content "$($webCsprojInfo.csprojDir)\Startup.cs"

}