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

Problem on opensource powershell #301

Closed
palxex opened this issue Aug 21, 2016 · 3 comments
Closed

Problem on opensource powershell #301

palxex opened this issue Aug 21, 2016 · 3 comments

Comments

@palxex
Copy link

palxex commented Aug 21, 2016

OSX version 6.0.0.alpha9 pkg version
PS > Import-Module posh-git
Exception calling "GetCurrent" with "0" argument(s): "Operation is not supported on this platform."
At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/posh-git/0.6.1.20160330/GitPrompt.ps1:93 char:1

  • $currentUser = [Security.Principal.WindowsPrincipal]([Security.Princi ...
  • - CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    - FullyQualifiedErrorId : PlatformNotSupportedException
    
    

You cannot call a method on a null-valued expression.
At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/posh-git/0.6.1.20160330/GitPrompt.ps1:94 char:1

  • $isAdminProcess = $currentUser.IsInRole([Security.Principal.WindowsBu ...
  • - CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    - FullyQualifiedErrorId : InvokeMethodOnNull
    
    

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/posh-git/0.6.1.20160330/GitUtils.ps1:231 char:23

  • $path = Join-Path ($Env:TEMP) ".ssh\$key.env"
    
  •                   ~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Test-Path : Cannot bind argument to parameter 'Path' because it is null.
At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/posh-git/0.6.1.20160330/GitUtils.ps1:232 char:19

  • if (Test-Path $path) {
    
  •               ~~~~~
    
    • CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand

Join-Path : Cannot bind argument to parameter 'Path' because it is null.
At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/posh-git/0.6.1.20160330/GitUtils.ps1:231 char:23

  • $path = Join-Path ($Env:TEMP) ".ssh\$key.env"
    
  •                   ~~~~~~~~~~~
    
    • CategoryInfo : InvalidData: (:) [Join-Path], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.JoinPathCommand

Test-Path : Cannot bind argument to parameter 'Path' because it is null.
At /usr/local/microsoft/powershell/6.0.0-alpha.9/Modules/posh-git/0.6.1.20160330/GitUtils.ps1:232 char:19

  • if (Test-Path $path) {
    
  •               ~~~~~
    
    • CategoryInfo : InvalidData: (:) [Test-Path], ParameterBindingValidationException
    • FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,Microsoft.PowerShell.Commands.TestPathCommand
@theaquamarine
Copy link
Collaborator

What platform is this on?

[Security.Principal.WindowsIdentity]::GetCurrent() isn't supported, which is responsible for the first two errors. I've mentioned that in #302.

Looks like $env:Temp isn't populated under PowerShell on Linux. I'm not sure how important that is, as all the supported platforms have ssh agents which work some other way and I think that's all we use it for.

@palxex
Copy link
Author

palxex commented Aug 21, 2016

Powershell OSX 6.0.0.alpha9. Sorry forgot mentioning in title.

@rkeithhill
Copy link
Collaborator

I have checked in a fix for this. See PR #312

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

No branches or pull requests

3 participants