-
Notifications
You must be signed in to change notification settings - Fork 4
/
CreateProject.ps1
31 lines (25 loc) · 1.22 KB
/
CreateProject.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
param ( [Parameter(Mandatory=$true)] [string]$ProjectName )
New-Item -ItemType Directory -Path $ProjectName
# Create README.md
New-Item -ItemType File -Path "$ProjectName\README.md"
$readmeContent = @"
# $ProjectName
- [ ] Configure AppHost by using ``builder.AddProject<$ProjectName_Web>();``
- [ ] Configure $ProjectName.Web Program.cs by calling ``builder.AddServiceDefaults();``
"@
Set-Content -Path "$ProjectName\README.md" -Value $readmeContent
# Create project's folder structure
Set-Location $ProjectName
dotnet new gitignore
dotnet new sln
# Fluent UI Blazor Web
dotnet new fluentblazor --name "$ProjectName.Web"
dotnet sln add "$ProjectName.Web/$ProjectName.Web.csproj"
# Aspire.AppHost
dotnet new aspire-apphost --name "$ProjectName.AppHost"
dotnet sln add "$ProjectName.AppHost/$ProjectName.AppHost.csproj"
dotnet add "$ProjectName.AppHost/$ProjectName.AppHost.csproj" reference "$ProjectName.Web/$ProjectName.Web.csproj"
# Aspire.ServiceDefaults
dotnet new aspire-servicedefaults --name "$ProjectName.ServiceDefaults"
dotnet sln add "$ProjectName.ServiceDefaults/$ProjectName.ServiceDefaults.csproj"
dotnet add "$ProjectName.Web/$ProjectName.Web.csproj" reference "$ProjectName.ServiceDefaults/$ProjectName.ServiceDefaults.csproj"