@@ -27,11 +27,13 @@ if ($IsWindows -eq $false) {
27
27
$script :TargetFrameworks = ' netstandard2.0' , ' net452'
28
28
}
29
29
30
- $script :Psm1Path = [System.IO.Path ]::Combine($PSScriptRoot , ' PSCompatibilityAnalyzer.psm1' )
31
- $script :Psd1Path = [System.IO.Path ]::Combine($PSScriptRoot , ' PSCompatibilityAnalyzer.psd1' )
30
+ $script :ModuleName = Split-Path $PSScriptRoot - Leaf
31
+
32
+ $script :Psm1Path = [System.IO.Path ]::Combine($PSScriptRoot , " $script :ModuleName .psm1" )
33
+ $script :Psd1Path = [System.IO.Path ]::Combine($PSScriptRoot , " $script :ModuleName .psd1" )
32
34
$script :ProfileDirPath = [System.IO.Path ]::Combine($PSScriptRoot , ' profiles' )
33
35
34
- $script :BinModDir = [System.IO.Path ]::Combine($PSScriptRoot , ' out' , ' PSCompatibilityAnalyzer ' )
36
+ $script :BinModDir = [System.IO.Path ]::Combine($PSScriptRoot , ' out' , " $ script :ModuleName " )
35
37
$script :BinModSrcDir = Join-Path $PSScriptRoot ' Microsoft.PowerShell.CrossCompatibility'
36
38
37
39
$script :PublishDlls = @ {
@@ -89,8 +91,8 @@ function Publish-CrossCompatibilityModule
89
91
throw " $DestinationDir exists but is not a directory. Aborting."
90
92
}
91
93
92
- Copy-Item - LiteralPath $script :Psd1Path - Destination (Join-Path $DestinationDir ' PSCompatibilityAnalyzer .psd1' )
93
- Copy-Item - LiteralPath $script :Psm1Path - Destination (Join-Path $DestinationDir ' PSCompatibilityAnalyzer .psm1' )
94
+ Copy-Item - LiteralPath $script :Psd1Path - Destination (Join-Path $DestinationDir " $ script :ModuleName .psd1" )
95
+ Copy-Item - LiteralPath $script :Psm1Path - Destination (Join-Path $DestinationDir " $ script :ModuleName .psm1" )
94
96
Copy-Item - Recurse - LiteralPath $script :ProfileDirPath - Destination $DestinationDir - ErrorAction Ignore
95
97
96
98
foreach ($framework in $TargetFramework )
@@ -118,7 +120,7 @@ if ($Clean)
118
120
}
119
121
120
122
# Only build if the output directory does not exist
121
- if (-not (Test-Path " $PSScriptRoot /out/PSCompatibilityAnalyzer " ))
123
+ if (-not (Test-Path " $PSScriptRoot /out/$ script :ModuleName " ))
122
124
{
123
125
if ($Framework )
124
126
{
@@ -136,7 +138,7 @@ if (-not (Test-Path "$PSScriptRoot/out/PSCompatibilityAnalyzer"))
136
138
}
137
139
else
138
140
{
139
- Write-Verbose " PSCompatibilityAnalyzer module already built -- skipping build"
141
+ Write-Verbose " $ script :ModuleName module already built -- skipping build"
140
142
Write-Verbose " Use '-Clean' to force building"
141
143
}
142
144
0 commit comments