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

posh 6 (osx) #3

Open
Plork opened this issue Apr 16, 2018 · 7 comments
Open

posh 6 (osx) #3

Plork opened this issue Apr 16, 2018 · 7 comments

Comments

@Plork
Copy link

Plork commented Apr 16, 2018

Any plans to support this for Powershell 6 on Mac?

For what I can see the module works it just cannot save the "profiles" because of the whole forward / backslack issue.

New-VltAuth : Access to the path '/Users/<username>\.vault-address' is denied.

I am pretty decent in Powershell but this is written in c# so will need to get myself some new skills to work on this myself.

@Plork
Copy link
Author

Plork commented Apr 16, 2018

looks hardcoded at the moment:

public const string CliVaultTokenCacheFile = @"$HOME\.vault-token";

public const string VaultAddressCacheFile = @"$HOME\.vault-address";
public const string VaultProfilesDir = @"$HOME\.vault-profiles";

maybe an option to use
https://msdn.microsoft.com/en-us/library/system.io.path.combine(v=vs.110).aspx

@Plork
Copy link
Author

Plork commented Apr 16, 2018

public static readonly string CliVaultTokenCacheFile = Path.Combine(@"$HOME",".vault-token");
public static readonly string VaultAddressCacheFile = Path.Combine(@"$HOME",".vault-address");
public static readonly string VaultProfilesDir = Path.Combine(@"$HOME",".vault-profiles");

I can't test it unfortunately, since it won't compile on my mac ;)

@ebekker
Copy link
Member

ebekker commented Apr 16, 2018

Yes, the plan is to migrate it over to PowerShell Standard 5.1 so then it will be compatible with both Windows PowerShell 5.x and PowerShell Core 6. This work might start soon.

Not sure how you mean by hardcoded -- thos constant path strings are fed into the PowerShell library's InvokeCommand.ExpandString which will actually resolve the $HOME variable to the user's home directory.

@ebekker
Copy link
Member

ebekker commented Apr 16, 2018

In the PowerShell Core variation of ExpandString, either \ or / characters in paths get translated to the platform's native path separator character.

@Plork
Copy link
Author

Plork commented Apr 17, 2018

oh the expansion of the $HOME isn't the issue .. its the .vault-address at the end. (the backslash)

But like i said my c# is newb level. So i haven't read and understood your code fully.

@nvarscar
Copy link

Yeah. I'm running into this issue too. I'm not seeing this behaviour in my PS console unfortunately:

$ExecutionContext.InvokeCommand.ExpandString('/Users/test\.vault-address')
/Users/test\.vault-address

@dconnolly-sfdc
Copy link

any plans to resolve this issue ?

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

4 participants