Read-UserEntry
This is a utility cmdlet that captures input from the user and validates it against a regex pattern. If a default value is provided, the user can accept it by pressing Enter.
Syntax
Read-UserEntry `
-Label <string> `
[-Description <string>] `
[-Default <string>] `
[-Pattern <string>]
Parameters
Parameter | R | Description |
---|---|---|
Label | * | Identifies the data being captured to the user. Example: -Label "Height Above Sea Level" |
Description | Optional description and/or instructions for user entry. Example: -Description "The target SQL Server database server address." |
|
Default | Default entry, which the user can accept by pressing the Enter key. Example: -Default "0" |
|
Pattern | Regex pattern against which user input will be validated. Default: ".*" Example: -Pattern "\d+" |