Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation issues with Powershell 7 and Install-Module #989

Open
e-Dan-K opened this issue Feb 20, 2025 · 3 comments
Open

Installation issues with Powershell 7 and Install-Module #989

e-Dan-K opened this issue Feb 20, 2025 · 3 comments

Comments

@e-Dan-K
Copy link

e-Dan-K commented Feb 20, 2025

I was trying to install posh-git under Powershell 7.5 using the README instructions, and the results were that it worked perfect in my Adminstrator windows, but the module was never visible under the normal user window.

After fiddling with Get-Module -ListAvailable , I finally figured out what was up: Installing via PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force was putting the module in my Documents directory, rather than the Powershell modules directory, and (for some reason that I still don't know) only Administrator looks in that directory for available modules.

I switched the install command to just PowerShellGet\Install-Module posh-git and it installed in the regular Powershell modules directory and started working perfect from all windows/users.

Is there a reason the install instructions recommend -Scope CurrentUser?

@amgcc
Copy link

amgcc commented Feb 24, 2025

I followed your instructions and it does seem that Install-Module without the scope was required to get it listed via Get-Module. However, tab completion is still broken for me on Powershell 7, how about you @e-Dan-K ?

@e-Dan-K
Copy link
Author

e-Dan-K commented Feb 24, 2025

However, tab completion is still broken for me on Powershell 7, how about you @e-Dan-K ?

Is only tab completion broken, or is everything not working? (ie the prompt change, etc). Once you've gotten it listed via Get-Module, you still need to run the Add-PoshGitToProfile to get it to show up in your appropriate startup profile. Everything is working properly for me now.

Something that I noticed while debugging my issues (before I found that the module wasn't available in Get-Module) was that I didn't even have any of the profile files, so I manually created them (blank), thinking that might be problem. I don't know whether or not them not existing would have been a problem once the module was in the proper location.

@Prince-K-Ado
Copy link

While using a shorten PATH for the directory in Powershell with
function prompt {
"PS " + (get-location).drive.name+":..."+ $( ( get-item $pwd ).Name ) +">"
}
Posh-git does not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants