$params = @{ "publish_folder" = "_Published" }; function Write2 { Param ([string] $str1) Write-Output "-----------------------------------------------" Write-Output $str1 Write-Output "-----------------------------------------------" } $dotnet = $args | where { $_ -eq "dotnet" } $spa = $args | where { $_ -eq "spa" } if ((!$dotnet) -and (!$spa)) { $dotnet = "dotnet" $spa = "spa" } if ($dotnet -eq "dotnet") { Write2 "dotnet publish" dotnet publish MyOffice.Web\MyOffice.Web.csproj -c Release -f net6.0 -o $params["publish_folder"] } if ($spa -eq "spa") { Write2 "ng build" cd MyOffice.SPA $path = "..\" + $params["publish_folder"] + "\wwwroot" ng build --output-path $path cd .. }