<# FPS:Containers:Common:Public:Get-Answer:ACTIVE #>

 

function Get-Answer ([string]$pQuestion) {

 

<#

 

.DDESCRIPTION

Module: Common

Public CmdLet: Get-Answer

Dependencies: None

 

.DESCRIPTION

Simple function that asks a question until a reply is given.  The reply is then sent back to the calling script.

   

.USAGE

Called throughout FPS to determine a CmdLet's existence.  Returns a boolean balue

 

.EXAMPLE

if (Push-NeededFor Get-Answer) { . (Get-ActiveFileNm -PS1 Get-Answer) }

$myAnswer = Get-Answer "How many times?"

 

Expected Result: The answer

 

.CC

 

[2024.09.25 JD] Original code release

 

.NOTES

 

#>

    do    {$strAnswer = Read-Host $pQuestion}

    until ($strAnswer.length -gt 0)

 

    $strAnswer

 

}