diff --git a/PwshSpectreConsole/public/prompts/Read-SpectreText.ps1 b/PwshSpectreConsole/public/prompts/Read-SpectreText.ps1 index 8bd79794..8b5848f1 100644 --- a/PwshSpectreConsole/public/prompts/Read-SpectreText.ps1 +++ b/PwshSpectreConsole/public/prompts/Read-SpectreText.ps1 @@ -22,10 +22,12 @@ function Read-SpectreText { [Reflection.AssemblyMetadata("title", "Read-SpectreText")] param ( [string] $Question = "What's your name?", - [string] $DefaultAnswer = "Prefer not to say" + [string] $DefaultAnswer ) $prompt = [Spectre.Console.TextPrompt[string]]::new($Question) $prompt.DefaultValueStyle = [Spectre.Console.Style]::new($script:DefaultValueColor) - $prompt = [Spectre.Console.TextPromptExtensions]::DefaultValue($prompt, $DefaultAnswer) + if($DefaultAnswer) { + $prompt = [Spectre.Console.TextPromptExtensions]::DefaultValue($prompt, $DefaultAnswer) + } return Invoke-SpectrePromptAsync -Prompt $prompt } \ No newline at end of file