Closed aikiox closed 2 years ago
I guess we need to replace it with something else
$ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("C:\Win")
This seems to work
Based on: https://stackoverflow.com/questions/3038337/powershell-resolve-path-that-might-not-exist it can resolve PSdrive paths as well.
Sorry for that.
I believe this is now fixed.
Hello, Since version
0.1.7
, I have a different behavior with theProtect-PGP
command. I use the-OutFilePath
parameter to create the encrypted file in a different directory than the-FilePath
to separate them. As this is an output file, the file path does not exist yet and I get a warning messageWARNING: Protect-PGP - Can't encrypt file : Cannot find path 'C:\Project\File.txt.pgp' because it does not exist.
I noticed, on line 65, the use of
Resolve-Path
which returns this error because the path does not exist. Usually, an output path is given for the file in order to create it so the file does not exist. I think we should remove this control or use it to add a warning that the output file already exists and that it will be rewritten asking for confirmation. In this case, add a -Force parameter to apply this change.Here is an example with the -Force parameter and a check if the file does not already exist.
Have a nice day, Romain