Read-SpectrePause
Description
The Read-SpectrePause function pauses the script execution and waits for user input to continue. It displays a message prompting the user to press the enter key to continue. If the end of the console window is reached, the function clears the message and moves the cursor up to the previous line.
Examples
Example 1
This example demonstrates how to use the Read-SpectrePause function.
Read-SpectrePause -Message "Press the [red]enter[/] key to continue, when you press it this message will disappear..."
# Type "↲" to dismiss the message
Example 2
This example demonstrates how to use the Read-SpectrePause function with the AnyKey parameter.
Read-SpectrePause -Message "Press the [red]ANY[/] key to continue, when you press it this message will disappear..." -AnyKey
# Type "x" to dismiss the message
Parameters
Message
The message to display to the user. The default message is “[default value color]Press [accent color]enter[/] to continue[/]“.
Type | Required | Position | PipelineInput | Aliases |
---|---|---|---|---|
[String] | false | 1 | false | Title Question Prompt |
AnyKey
Type | Required | Position | PipelineInput |
---|---|---|---|
[Switch] | false | named | false |
NoNewline
Indicates whether to write a newline character before displaying the message. By default, a newline character is written.
Type | Required | Position | PipelineInput |
---|---|---|---|
[Switch] | false | named | false |
Syntax
Read-SpectrePause [[-Message] <String>] [-AnyKey] [-NoNewline] [<CommonParameters>]