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

Cannot Add-PoshGitToProfile -AllHosts in installation #926

Open
WorikQCI opened this issue Sep 30, 2022 · 1 comment
Open

Cannot Add-PoshGitToProfile -AllHosts in installation #926

WorikQCI opened this issue Sep 30, 2022 · 1 comment

Comments

@WorikQCI
Copy link

During installation I struck this:

Add-PoshGitToProfile -AllHosts​​​​​​​
Test-Path : Cannot bind argument to parameter 'LiteralPath' because it is an empty string.
At C:\Users\64211\Documents\WindowsPowerShell\Modules\posh-git\1.1.0\Utils.ps1:208 char:34
+     if (!(Test-Path -LiteralPath $profileDir)) {
+                                  ~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationErrorEmptyStringNotAllowed,Microsoft.PowerShell.Commands.Test
   PathCommand

C:\Users\64211> Add-PoshGitToProfile -AllHosts​​​​​​​
WARNING: Skipping add of posh-git import to file '-AllHosts​​​​​​​'.
WARNING: posh-git appears to already be imported in one of your profile scripts.
WARNING: If you want to force the add, use the -Force parameter.
C:\Users\64211>

I do not know if it matters but it is disconcerting

System Details

Forgive me. I am a reluctant and novice windows user. I am happy to be responsive if it will help fix something but I am not happy to learn to answer, accurately, the following things unless there is a clear reason.

  • posh-git version/path: Latest
  • PowerShell version: Latest
  • Git version: Latest, but not relevant
  • Operating system name and version: Windows. on a laptop.

To retrieve the system details, paste the following line into PowerShell, press Enter
and then copy/paste the resulting output above.

"- posh-git version/path: $($m = Get-Module posh-git; '{0} {1} {2}' -f $m.Version,$m.PrivateData.PSData.Prerelease,$m.ModuleBase.Replace($HOME,'~'))n- PowerShell version: $($PSVersionTable.PSVersion)n- $(
git --version)`n- OS: $([System.Environment]::OSVersion)"

posh-git version/path: $($m = Get-Module posh-git; '{0} {1} {2}' -f $m.Version,$m.PrivateData.PSData.Prerelease,$m.ModuleBase.Replace($HOME,'~'))`n- PowerShell version: $($PSVersionTable.PSVersion)`n- $(
>> git --version)`n- OS: $([System.Environment]::OSVersion)
posh-git : The term 'posh-git' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ posh-git version/path: $($m = Get-Module posh-git; '{0} {1} {2}' -f $ ...
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (posh-git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

That did not go well!

@WorikQCI
Copy link
Author

Instructions I followed:

Install-Module posh-git -Scope CurrentUser -Force
Import-Module posh-git
Add-PoshGitToProfile -AllHosts​​​​​​​

That last instruction was where I started to see problems. But considering that posh-git is: "...is not "recognized as the name of a cmdlet, function, script file,..." the problem may be more fundemental

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

1 participant