File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed
Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change @@ -51,10 +51,21 @@ function Invoke-AppveyorTest {
5151 Write-Verbose - Verbose (" Running tests on PowerShell version " + $PSVersionTable.PSVersion )
5252 Write-Verbose - Verbose " Language set to '${env: LANG} '"
5353
54- # Copy the generated modules into the out directory
55- $modulePath = $env: PSModulePath.Split ([System.IO.Path ]::PathSeparator) | Where-Object { Test-Path $_ } | Select-Object - First 1
56- Copy-Item " ${CheckoutPath} \out\PSScriptAnalyzer" " $modulePath \" - Recurse - Force
57- Copy-Item " ${CheckoutPath} \PSCompatibilityCollector\out\PSCompatibilityCollector" " $modulePath \" - Recurse - Force
54+ # set up env:PSModulePath to the build location, don't copy it to the "normal place"
55+ $analyzerVersion = ([xml ](Get-Content " ${CheckoutPath} \Engine\Engine.csproj" )).SelectSingleNode(" .//VersionPrefix" )." #text" .Trim()
56+
57+ if ( $analyzerVersion -lt 5 ) {
58+ $versionModuleDir = " ${CheckoutPath} \out\PSScriptAnalyzer\${analyzerVersion} "
59+ Rename-Item " ${versionModuleDir} " " ${CheckoutPath} \out\PSScriptAnalyzer\PSScriptAnalyzer"
60+ $moduleDir = " ${CheckoutPath} \out\PSScriptAnalyzer"
61+ }
62+ else {
63+ $moduleDir = " ${CheckoutPath} \out"
64+ }
65+
66+ $env: PSModulePath = " ${moduleDir} " , " ${env: PSModulePath} " -join [System.IO.Path ]::PathSeparator
67+ Write-Verbose - Verbose " module path: ${env: PSModulePath} "
68+
5869
5970 # Set up testing assets
6071 $testResultsPath = Join-Path ${CheckoutPath} TestResults.xml
You can’t perform that action at this time.
0 commit comments