Closed jantari closed 1 year ago
Hey @jantari, thanks for reaching out. This is an excellent suggestion! I'll get the change in and it should be live in the next release. It will also work on non-Windows hosts as well, though it appears you still have to use the Windows style %NAME%
for it to work rather than $NAME
.
This is now live in 4.18.0
Reading the docs here: https://poshac.me/docs/v4/Guides/Using-an-Alternate-Config-Location/#why-bother
I understood it that I could use environment variables such as
%LOCALAPPDATA%
inside the POSHACME_HOME path. This would be expected as Windows itself also supports these variables inside%PATH%
paths. So I set my POSHACME_HOME to%ProgramData%\Posh-ACME
.But when I ran Posh-ACME after this change I got this warning (and then a bunch of erros):
imo Posh-ACME should call
[Environment]::ExpandEnvironmentVariables()
on the path it finds insidePOSHACME_HOME
so that these Windows-style environment variables are expanded and supported. Maybe someone wants to configure a different but still dynamic/per-user POSHACME_HOME such as a path inside %AppData% or %USERPROFILE% or just in another directory inside %LOCALAPPDATA% these additional usecases would also be enabled by this.Currently I have hardcoded the path as a temporary workaround but this is very suboptimal as the path of %ProgramData% is not always
C:\ProgramData
on all systems.Thanks!