1
1
[CmdletBinding ()]
2
2
param (
3
- [Parameter (ParameterSetName = ' Build' )]
4
3
[ValidateSet (' PSV3 Debug' , ' PSV3 Release' , ' Debug' , ' Release' )]
5
4
[string ] $Configuration = ' Debug' ,
6
5
7
- [Parameter (ParameterSetName = ' Build' )]
6
+ [switch ] $BuildSolution = $false ,
7
+
8
8
[switch ] $CleanSolution = $false ,
9
9
10
- [Parameter (ParameterSetName = ' Documentation' )]
11
- [switch ] $Documentation = $false ,
10
+ [switch ] $BuildDocs = $false ,
12
11
13
- [Parameter (ParameterSetName = ' Clean' )]
14
- [switch ] $Clean = $false ,
12
+ [switch ] $CleanOutput = $false ,
15
13
16
- [Parameter (ParameterSetName = ' Install' )]
17
14
[switch ] $Install = $false
18
15
)
19
16
@@ -49,23 +46,22 @@ if (-not (Test-Path $buildCmd))
49
46
throw " cannot find build.cmd"
50
47
}
51
48
49
+ if ($CleanOutput )
50
+ {
51
+ Remove-Item - Recurse $outPath \* - Force - Verbose:$verbosity
52
+ }
52
53
53
- if ($PSCmdlet .ParameterSetName -eq ' Clean ' )
54
+ if ($CleanSolution )
54
55
{
55
- Remove-Item - Recurse $outPath \ * - Force
56
+ & $buildCmd $solutionPath $Configuration ' clean '
56
57
}
57
58
58
- if ($PSCmdlet .ParameterSetName -eq ' Build ' )
59
+ if ($BuildSolution )
59
60
{
60
- if ($CleanSolution )
61
- {
62
- & $buildCmd $solutionPath $Configuration ' clean'
63
- return
64
- }
65
61
& $buildCmd $solutionPath $Configuration
66
62
}
67
63
68
- if ($PSCmdlet .ParameterSetName -eq ' Documentation ' )
64
+ if ($BuildDocs )
69
65
{
70
66
$docsPath = Join-Path $projectRoot ' docs'
71
67
$markdownDocsPath = Join-Path $docsPath ' markdown'
@@ -91,7 +87,7 @@ if ($PSCmdlet.ParameterSetName -eq 'Documentation')
91
87
New-ExternalHelp - Path $markdownDocsPath - OutputPath $outputDocsPath - Force - Verbose:$verbosity
92
88
}
93
89
94
- if ($PSCmdlet .ParameterSetName -eq ' Install' )
90
+ if ($Install )
95
91
{
96
92
$modulePath = Join-Path (Split-Path $profile ) ' Modules'
97
93
if (-not (Test-Path $modulePath ))
0 commit comments