Fix adding Import-Module command to the profile in Install-PSPackage

This commit is contained in:
Shivam Mathur committed 2022-02-08 01:02:16 +05:30
1 parent ce2a129c36
commit 0cfde7beae
1 file changed
+2 -2
+2 -2
View File
@@ -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"
}
}