Closed devblackops closed 6 years ago
You should be able use it by specifying the storage paths on import (as we do in testing), or just setting the environment variables for AppData, LocalAppData, and ProgramData (that is, machine AppData). It's all on lines 4-7
But I'm not sure what paths to use on linux, or how to determine across all the supported distros, so I haven't fixed it yet. Any thoughts?
I'd be willing to loose the separation of "user" vs "user roaming" to support the lowest common denominator if need be, but what paths would need to be used for User-specific vs Machine-wide settings?
for the user profile, you could abstract the environment variable aspect and use $UserData = (Join-Path "~" "\AppData\Local")
, then create the folder structure if not there (this is what the AWS .NET SDK does for the SDKCredentialStore, albeit clunky and not very OS agnostic feeling)
I don't know if there is really an equivalent for $env:AppData
in *nix.
I think the logical mapping of $env:ProgramData
and $env:LocalAppData
would be:
~/.<modulefoo>
/etc/<modulefoo>
Anyone with more *nix experience feel free to correct me.
Ran into some of this toying with psneo4j xplat. Another thing to change is the mkdir
call. IIRC that, along with the overridden paths, got things up and running.
Cheers!
@RamblingCookieMonster did they remove that function on Linux, or am I missing something?
They do! just... not with -Force
- changed it to New-Item -ItemType Directory
That's ok, I just recently became aware that -Force
is flawed (if there's file and you're trying to make a folder, it silently does ... nothing). We should make that ... safer.
Any of you willing to pull my /dev branch, run build, and try it on OS X or Linux? ;)
OK. Fine. I've got the tests working on Linux and it's ... working. Shipped 1.2.0 Open new issues if there any problems 😁
@Jaykul Any there any plans/desire to add cross-platform support to this module?
Skimming through the source, I don't see anything that would prevent this module from working on Linux/MacOS (other than the use of Windows-specific environment variables for where to store the configuration(s).