Show-Input
Shows prompt message box asking user to provide a text string.
Syntax
Show-Input [-Prompt] <String> [-DefaultValue <String>] [-Validation <String>] [-ErrorMessage <String>] [-MaxLength <Int32>]
Detailed Description
Shows prompt message box asking user to provide a text string.
© 2010-2019 Adam Najmanowicz, Michael West. All rights reserved. Sitecore PowerShell Extensions
Parameters
-Prompt <String>
Prompt message to show in the message box shown to a user.
Required?
true
Position?
1
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-DefaultValue <String>
Default value to be provided for the text box.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-Validation <String>
Regex for value validation. If user enters a value that does not validate - en error message defined with the "ErrorMessage" parameter will be shown and user will be asked to enter the value again.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-ErrorMessage <String>
Error message to show when regex validation fails.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
-MaxLength <Int32>
Maximum length of the string returned. If user enters a longer value - en error message will be shown and user will be asked to enter the value again.
Required?
false
Position?
named
Default Value
Accept Pipeline Input?
false
Accept Wildcard Characters?
false
Outputs
The output type is the type of the objects that the cmdlet emits.
System.String
Notes
Help Author: Adam Najmanowicz, Michael West
Examples
EXAMPLE 1
Requests that the user provides an email, validates it against a regular expression snd whows an allert if the format is not valid
EXAMPLE 2
Uses Show-Input command to request user a new name for the content item validating the proper characters are used and assigns the result to $newName variable (nothing gets changed)
EXAMPLE 3
Requests that the user provides a string of at most 5 characters
Related Topics
Last updated