Skip to main content

PowerShell values and results

The module uses PSCustomObject values with a PSTypeName for its specifications and structured results. Use their named properties in scripts. The input type table defines each prompt value type.

Fluence.DialogResult​

Show-FluenceDialog returns one property for each prompt and button, plus the outcome flags:

PropertyTypeMeaning
Prompt NameDepends on input type.Value captured when the dialog closed; an untouched prompt keeps its default.
Button NameboolTrue for the selected action.
CancelledboolTrue for a cancel action, Esc, or title bar dismissal.
TimedOutboolTrue when -Timeout expires; no button flag is true.

Exactly one button flag, Cancelled, or TimedOut describes a normal close. A failure that leaves the UI without a result is represented by a minimal cancelled result. Prompt and button names must be unique without regard to case and cannot use the reserved result names.

The default console view shows only Cancelled and TimedOut. Explicit access, Format-List *, and serialization can expose prompt values. Password values are SecureString unless -AsPlainText was requested; dispose secure values from a dialog result even when the dialog was cancelled.

Simple command results​

CommandResult
Show-FluenceMessageButton name string: OK, Cancel, Yes, or No. A dismiss maps to the cancel button or final preset button; timeout uses -DefaultButton when supplied.
Get-FluenceInputEntered value, or $null on cancel or timeout.
Show-FluenceListSelectionSelected value or array for -MultiSelect, or $null on cancel or timeout.
Show-FluenceRestartPromptRestart, Later, or TimedOut.

Fluence.Prompt and Fluence.Button​

New-FluencePrompt returns a Fluence.Prompt specification for Show-FluenceDialog -Prompts.

Prompt propertyMeaning
Name, Message, InputTypeResult key, visible label, and input type. An omitted name is generated as Input_ plus eight hex characters.
DefaultValue, ValidateSetInitial value and allowed choices for Choice or List.
As, MultiSelect, AsPlainTextRadio or combo choice layout, multiple list values, or plain password result.
ValidateNotEmpty, ValidatePattern, ValidateScriptValidation rules evaluated on a non-cancel action.

New-FluenceButton returns a Fluence.Button with Text, Name, IsDefault, and IsCancel. Name defaults to Text. The default button responds to Enter; the cancel button responds to Esc and bypasses validation. A bare Cancel string becomes a cancel button automatically.

Fluence.ProgressHandle​

Show-FluenceProgress returns a handle used by Update-FluenceProgress and Close-FluenceProgress.

PropertyMeaning
IdWindow GUID.
ModeInline for a calling STA UI thread or Runspace for the module UI runspace.
IsOpenFalse after close.
StateSynchronized hashtable with Message, Detail, PercentComplete, Indeterminate, and CloseRequested.
SpecOpening options including title, position, width, theme, backdrop, and accent.
PartsLive WPF window and control objects; read their dependency properties only from the owning thread.

Only one progress window can be open at a time.

Fluence.WindowResult​

Show-FluenceWindow -PassThru returns Result, the value passed to Close-FluenceWindow -Result or $null, and Closed = $true. Without -PassThru, Show-FluenceWindow returns the result value directly.

Fluence.ThemeInfo​

Get-FluenceTheme returns CurrentTheme (the request), ResolvedTheme (the displayed theme), CurrentBackdrop, and IsAppInDarkMode. Compare the backdrop enum by .ToString(): newer library builds use WindowBackdropType, while earlier builds use BackdropType.