forked from WCOMAB/WCOM.AzurePipelines.Selenium.Agent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprimedotnet.ps1
More file actions
55 lines (45 loc) · 1.25 KB
/
primedotnet.ps1
File metadata and controls
55 lines (45 loc) · 1.25 KB
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/home/seluser/.dotnet/tools/pwsh
$ErrorActionPreference = "Stop"
Set-StrictMode -Version 7.3
[string[]] $netversions = @(
'8.0',
'9.0',
'10.0'
)
[string[]] $templates = @(
'console',
'web',
'classlib',
'mstest',
'xunit',
'nunit'
)
[long] $ResultCode = 0
$netversions `
| ForEach-Object {
[string] $netversion =$_
[string] $framwork ="net$netversion"
[string] $sdkVersion ="$netversion.0"
Push-Location
New-Item -Path $framwork -ItemType Directory `
| Set-Location
dotnet new globaljson --force --sdk-version $sdkVersion --roll-forward latestFeature
dotnet --version
dotnet --info
$templates `
| ForEach-Object {
[string] $template = $_
[string] $project = "test$template"
Push-Location
New-Item -Path $template -ItemType Directory `
| Set-Location
dotnet new $template -n $project --framework $framwork
dotnet build $project --verbosity Minimal
$ResultCode+=$LASTEXITCODE
Pop-Location
Remove-Item -Recurse -Force $template
}
Pop-Location
Remove-Item -Recurse -Force $framwork
}
exit $ResultCode