Skip to content
This repository has been archived by the owner on Dec 21, 2024. It is now read-only.

Commit

Permalink
Prevents exporting console output if there is nothing in it
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangeRanger committed Mar 10, 2024
1 parent 0d7b1bd commit 6f12c46
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ActiveDirectoryQuerier/MainWindowViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,15 @@ private async void OutputToCsvFileAsync(object _)
/// <param name="_">This is the object that the command is bound to.</param>
private void ExportConsoleOutput(object _)
{
if (PowerShellOutput.ConsoleOutput.Length == 0)
{
MessageBox.Show("The console is empty.",
"Information",
MessageBoxButton.OK,
MessageBoxImage.Information);
return;
}

SaveFileDialog saveFileDialog = new() { DefaultExt = ".txt", Filter = "Text documents (.txt)|*.txt" };

bool? result = saveFileDialog.ShowDialog();
Expand Down

0 comments on commit 6f12c46

Please sign in to comment.