Zyborg.Vault icon indicating copy to clipboard operation
Zyborg.Vault copied to clipboard

posh 6 (osx)

Open Plork opened this issue 7 years ago • 7 comments

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 avatar Apr 16 '18 18:04 Plork

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 avatar Apr 16 '18 18:04 Plork

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 ;)

Plork avatar Apr 16 '18 18:04 Plork

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 avatar Apr 16 '18 21:04 ebekker

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

ebekker avatar Apr 16 '18 21:04 ebekker

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.

Plork avatar Apr 17 '18 20:04 Plork

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

nvarscar avatar Nov 28 '19 22:11 nvarscar

any plans to resolve this issue ?

dconnolly-sfdc avatar Dec 09 '21 16:12 dconnolly-sfdc