Skip to content

Commit ed5bf53

Browse files
Update dbatools.psm1
1 parent 90b1829 commit ed5bf53

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

dbatools.psm1

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,12 @@ if (-not $script:libraryroot) {
5252
}
5353

5454
try {
55-
$dll = [System.IO.Path]::Combine($script:libraryroot, "dbatools.dll")
55+
# if core add core to the path, otherwise add desktop
56+
if ($PSVersionTable.PSEdition -eq 'Core') {
57+
$script:libraryroot = [System.IO.Path]::Combine($script:libraryroot, 'core', 'dbatools.dll')
58+
} else {
59+
$script:libraryroot = [System.IO.Path]::Combine($script:libraryroot, 'desktop', 'dbatools.dll')
60+
}
5661
Import-Module $dll
5762
} catch {
5863
throw "Couldn't import dbatools library | $PSItem"

0 commit comments

Comments
 (0)