Skip to content

Commit aef55a1

Browse files
authored
fix win core install path (#18)
1 parent c0ed7e9 commit aef55a1

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

InvokeTests.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ function InstallModule ([string]$Name,[version]$Version){
88
Install-Module -Name $Name -Force -SkipPublisherCheck -Scope CurrentUser -Repository PSGallery
99
Import-Module $Name
1010
}
11-
Get-Module $Name -List
11+
if ($env:TF_BUILD) {Get-Module $Name -List}
1212
}
1313

1414
#

Private/Get-InstallPath.ps1

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ function Get-InstallPath {
66
} else {
77
# https://github.com/PowerShell/PowerShellGet/blob/8004c304a2fa8ad32b92c6c2ba7efe116df3c862/src/PowerShellGet/private/modulefile/PartOne.ps1#L46
88
try {
9-
[Environment]::GetFolderPath("MyDocuments") + '\WindowsPowerShell\Modules'
9+
if ($PSVersionTable.PSEdition -eq 'Core') {
10+
[Environment]::GetFolderPath("MyDocuments") + '\PowerShell\Modules'
11+
} else {
12+
[Environment]::GetFolderPath("MyDocuments") + '\WindowsPowerShell\Modules'
13+
}
1014
} catch {
1115
"$home\Documents\PowerShell\Modules"
1216
}

0 commit comments

Comments
 (0)