Last active
September 17, 2018 20:40
-
-
Save akamsteeg/daa7edce3fb1f9f3da52ce20f60a40e8 to your computer and use it in GitHub Desktop.
Create a .NET Core project of the specified type with a solution and optionally a XUnit unit test project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param( | |
[Parameter(Mandatory=$True)][string]$projectName, | |
[Parameter(Mandatory=$True)][string]$projectType, | |
[Parameter(Mandatory=$True)][bool]$createUnitTest=$False | |
) | |
dotnet new sln --name $projectName | |
dotnet new $projectType --name $projectName | |
dotnet sln $projectName.sln add $projectName\$projectName.csproj | |
if ($createUnitTest -eq $True) | |
{ | |
$testProjectName = $projectName + '.Tests' | |
dotnet new xunit --name $testProjectName | |
dotnet add $testProjectName\$testProjectName.csproj reference $projectName\$projectName.csproj | |
dotnet sln $projectName.sln add $testProjectName\$testProjectName.csproj | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment