Skip to content

Commit 89549b5

Browse files
Update install-dbatools-library.ps1
1 parent e8663c8 commit 89549b5

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

.github/scripts/install-dbatools-library.ps1

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,11 @@ function Install-FromGitHubRelease {
246246

247247
# Add the modules directory to PSModulePath if not already present
248248
$modulesBasePath = Split-Path $finalInstallPath -Parent
249-
$modulesRootPath = Split-Path $modulesBasePath -Parent
250249
$currentPSModulePath = $env:PSModulePath -split [System.IO.Path]::PathSeparator
251250

252-
if ($modulesRootPath -notin $currentPSModulePath) {
253-
$env:PSModulePath = $modulesRootPath + [System.IO.Path]::PathSeparator + $env:PSModulePath
254-
Write-Log "Added '$modulesRootPath' to PSModulePath for this session" -Level 'Success'
251+
if ($modulesBasePath -notin $currentPSModulePath) {
252+
$env:PSModulePath = $modulesBasePath + [System.IO.Path]::PathSeparator + $env:PSModulePath
253+
Write-Log "Added '$modulesBasePath' to PSModulePath for this session" -Level 'Success'
255254
}
256255

257256
# Cleanup

0 commit comments

Comments
 (0)