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

PowerShell auto-login not working on Linux #2491

Closed
aelij opened this issue Dec 10, 2023 · 3 comments · Fixed by #2558
Closed

PowerShell auto-login not working on Linux #2491

aelij opened this issue Dec 10, 2023 · 3 comments · Fixed by #2558
Assignees
Labels
login Bugs related a login command

Comments

@aelij
Copy link
Member

aelij commented Dec 10, 2023

Which version of the AzCopy was used?

10.22.0

Which platform are you using?

Linux

What command did you run?

$env:AZCOPY_AUTO_LOGIN_TYPE='PSCRED'
azcopy cp ...

What problem was encountered?

INFO: Scanning...

Failed to perform Auto-login: PSContextCredentialexec: "powershell": executable file not found in $PATH.

Have you found a mitigation/solution?

The problem is here:

cliCmd := exec.CommandContext(ctx, "powershell", cmd)

The executable for the cross-platform version of PowerShell is called pwsh. Even on Windows, I believe you should see if it exists and use it rather than the legacy Windows PowerShell 5.

Note this might also be the root cause for #2490.

@gapra-msft
Copy link
Member

@nakulkar-msft please take a look

@sindkor
Copy link

sindkor commented Dec 28, 2023

I'm experiencing the same issue in MacOS (Version 14.0, ARM-based system):

PS> azcopy --version
azcopy version 10.22.1
PS> Write-Output $env:AZCOPY_AUTO_LOGIN_TYPE
PSCRED
PS> azcopy copy ./file "https://storageaccount.file.core.windows.net/fileshare/file"
INFO: Scanning...

Failed to perform Auto-login: PSContextCredentialexec: "powershell": executable file not found in $PATH.

@ericyew
Copy link

ericyew commented Jan 8, 2024

Same issue. It's trying to find windows powershell instead of pwsh
Failed to perform Auto-login: PSContextCredentialexec: "powershell": executable file not found in $PATH.

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

Successfully merging a pull request may close this issue.

5 participants