Skip to content

Commit

Permalink
Fix adding Import-Module command to the profile in Install-PSPackage
Browse files Browse the repository at this point in the history
  • Loading branch information
shivammathur committed Feb 7, 2022
1 parent ce2a129 commit 0cfde7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/scripts/win32.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ Function Install-PSPackage() {
Expand-Archive -Path $zip_file -DestinationPath $bin_dir -Force
}
Import-Module $module_path
Add-ToProfile $current_profile "$package-search" "Import-Module $module_path"

if($null -eq (Get-Command $cmdlet -ErrorAction SilentlyContinue)) {
Install-Module -Name $package -Force
} else {
Add-ToProfile $current_profile "$package-search" "Import-Module $module_path"
}
}

Expand Down

0 comments on commit 0cfde7b

Please sign in to comment.