It just occured to me that cmd.exe is windows-only
This commit is contained in:
@@ -35,6 +35,14 @@ public static class PasswordGenerator
|
||||
{
|
||||
ProcessBuilder pb = new ProcessBuilder();
|
||||
pb.ProcessFailed += (e) => ExceptionOccured?.Invoke(e);
|
||||
|
||||
if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
{
|
||||
return pb.GetOutput("cmd.exe", $"echo {RandomStr(length, no_symbols)} | gpg --quiet --encrypt --recipient {recipient}");
|
||||
}
|
||||
else
|
||||
{
|
||||
return pb.GetOutput("echo", $"{RandomStr(length, no_symbols)} | gpg --quiet --encrypt --recipient {recipient}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user