1
1
param (
2
- [switch ]$build ,
3
- [switch ]$uninstall ,
4
- [switch ]$install
2
+ [switch ]$Build ,
3
+ [switch ]$Uninstall ,
4
+ [switch ]$Install ,
5
+
6
+ [ValidateSet (" net451" , " netstandard1.6" )]
7
+ [string ]$Framework = " netstandard1.6" ,
8
+
9
+ [ValidateSet (" Debug" , " Release" )]
10
+ [string ]$Configuration = " Debug"
5
11
)
6
12
7
13
$solutionDir = Split-Path $MyInvocation.InvocationName
@@ -10,16 +16,20 @@ if (-not (Test-Path "$solutionDir/global.json"))
10
16
throw " Not in solution root"
11
17
}
12
18
13
- $itemsToCopyCoreCLR = @ (" $solutionDir \Engine\bin\Debug\netcoreapp1.0 \Microsoft.Windows.PowerShell.ScriptAnalyzer.dll" ,
14
- " $solutionDir \Rules\bin\Debug\netcoreapp1.0 \Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" )
19
+ $itemsToCopyBinaries = @ (" $solutionDir \Engine\bin\$Configuration \ $Framework \Microsoft.Windows.PowerShell.ScriptAnalyzer.dll" ,
20
+ " $solutionDir \Rules\bin\$Configuration \ $Framework \Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" )
15
21
16
22
$itemsToCopyCommon = @ (" $solutionDir \Engine\PSScriptAnalyzer.psd1" ,
17
23
" $solutionDir \Engine\PSScriptAnalyzer.psm1" ,
18
24
" $solutionDir \Engine\ScriptAnalyzer.format.ps1xml" ,
19
25
" $solutionDir \Engine\ScriptAnalyzer.types.ps1xml" )
20
26
21
27
$destinationDir = " $solutionDir /out/PSScriptAnalyzer"
22
- $destinationDirCoreCLR = " $destinationDir /coreclr"
28
+ $destinationDirBinaries = " $destinationDir "
29
+ if ($Framework -eq " netstandard1.6" )
30
+ {
31
+ $destinationDirBinaries = " $destinationDir /coreclr"
32
+ }
23
33
24
34
if ($build )
25
35
{
@@ -47,7 +57,7 @@ if ($build)
47
57
CopyToDestinationDir $itemsToCopyCommon $destinationDir
48
58
(Get-Content " $destinationDir \PSScriptAnalyzer.psd1" ) -replace " ModuleVersion = '1.6.0'" , " ModuleVersion = '0.0.1'" | Out-File " $destinationDir \PSScriptAnalyzer.psd1" - Encoding ascii
49
59
50
- CopyToDestinationDir $itemsToCopyCoreCLR $destinationDirCoreCLR
60
+ CopyToDestinationDir $itemsToCopyBinaries $destinationDirBinaries
51
61
}
52
62
53
63
$modulePath = " $HOME \Documents\WindowsPowerShell\Modules" ;
0 commit comments