Private/Cs/WebProj/New-MvcAngularProject.ps1
Function New-MvcAngularProject([SolnInfo] $solnInfo, [WebCsprojInfo] $webCsprojInfo) { Write-Host "### Making MVC Angular project" $webCsprojInfo.csprojName &{dotnet new angular -n $webCsprojInfo.csprojName -o $webCsprojInfo.csprojDir} Confirm-LastExitCode # Add proj to soln Write-Host "### Add" $webCsprojInfo.csprojName "to solution" $solnInfo.nickName &{dotnet sln $solnInfo.solnFile add $webCsprojInfo.csprojFile} Confirm-LastExitCode # Add nuget packages Write-Host "### Add nuget packages to" $webCsprojInfo.csprojName &{dotnet add $webCsprojInfo.csprojFile package BoxTurtleCs } Confirm-LastExitCode Write-Host "### Microsoft wants us to run npm install" [string] $curDir = Get-Location try { Set-Location $webCsprojInfo.csprojDir &{npm install} } finally { Set-Location $curDir } Confirm-LastExitCode } |