@@ -10,14 +10,16 @@ if (-not (Test-Path "$solutionDir/global.json"))
10
10
throw " Not in solution root"
11
11
}
12
12
13
- $itemsToCopy = @ (" $solutionDir \Engine\bin\Debug\netcoreapp1.0\Microsoft.Windows.PowerShell.ScriptAnalyzer.dll" ,
14
- " $solutionDir \Rules\bin\Debug\netcoreapp1.0\Microsoft.Windows.PowerShell.ScriptAnalyzer.BuiltinRules.dll" ,
15
- " $solutionDir \Engine\PSScriptAnalyzer.psd1" ,
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" )
15
+
16
+ $itemsToCopyCommon = @ (" $solutionDir \Engine\PSScriptAnalyzer.psd1" ,
16
17
" $solutionDir \Engine\PSScriptAnalyzer.psm1" ,
17
18
" $solutionDir \Engine\ScriptAnalyzer.format.ps1xml" ,
18
19
" $solutionDir \Engine\ScriptAnalyzer.types.ps1xml" )
19
20
20
- $destinationDir = " $solutionDir /out/coreclr/PSScriptAnalyzer"
21
+ $destinationDir = " $solutionDir /out/PSScriptAnalyzer"
22
+ $destinationDirCoreCLR = " $destinationDir /coreclr"
21
23
22
24
if ($build )
23
25
{
@@ -31,20 +33,21 @@ if ($build)
31
33
dotnet build
32
34
Pop-Location
33
35
34
- if (-not (Test-Path $destinationDir ))
35
- {
36
- New-Item - ItemType Directory $destinationDir - Force
37
- }
38
- else
36
+ Function CopyToDestinationDir ($itemsToCopy , $destination )
39
37
{
40
- Remove-Item " $destinationDir \*" - Recurse
41
- }
42
-
43
- foreach ($file in $itemsToCopy )
44
- {
45
- Copy-Item - Path $file - Destination (Join-Path $destinationDir (Split-Path $file - Leaf)) - Verbose
38
+ if (-not (Test-Path $destination ))
39
+ {
40
+ New-Item - ItemType Directory $destination - Force
41
+ }
42
+ foreach ($file in $itemsToCopy )
43
+ {
44
+ Copy-Item - Path $file - Destination (Join-Path $destination (Split-Path $file - Leaf)) - Verbose - Force
45
+ }
46
46
}
47
+ CopyToDestinationDir $itemsToCopyCommon $destinationDir
47
48
(Get-Content " $destinationDir \PSScriptAnalyzer.psd1" ) -replace " ModuleVersion = '1.6.0'" , " ModuleVersion = '0.0.1'" | Out-File " $destinationDir \PSScriptAnalyzer.psd1" - Encoding ascii
49
+
50
+ CopyToDestinationDir $itemsToCopyCoreCLR $destinationDirCoreCLR
48
51
}
49
52
50
53
$modulePath = " $HOME \Documents\WindowsPowerShell\Modules" ;
0 commit comments