diff --git a/Common/PasswordGenerator.cs b/Common/PasswordGenerator.cs index 0603694..f71cee0 100644 --- a/Common/PasswordGenerator.cs +++ b/Common/PasswordGenerator.cs @@ -35,6 +35,14 @@ public static class PasswordGenerator { ProcessBuilder pb = new ProcessBuilder(); pb.ProcessFailed += (e) => ExceptionOccured?.Invoke(e); - return pb.GetOutput("cmd.exe", $"echo {RandomStr(length, no_symbols)} | gpg --quiet --encrypt --recipient {recipient}"); + + 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}"); + } } }