external help file | Module Name | online version | schema |
---|---|---|---|
PSScriptTools-help.xml |
PSScriptTools |
2.0.0 |
Launch a graphical input box.
Invoke-InputBox [-Title <String>] [-Prompt <String>]
[-BackgroundColor <String>] [<CommonParameters>]
Invoke-InputBox [-Title <String>] [-Prompt <String>] [-AsSecureString]
[-BackgroundColor <String>] [<CommonParameters>]
Use this command as a graphical replacement for Read-Host. The command will write either a string or a secure string to the pipeline. You can customize the prompt, title and background color.
This command requires a Windows platform.
PS C:\> $name = Invoke-Inputbox -prompt "Enter a user name" -title "New User"
Display an graphical inputbox with a given prompt and title. The entered value will be saved to $name.
PS C:\> $pass = Invoke-Inputbox -prompt "Enter a new password"
-title "New User" -asSecureString -background red
Get a secure string value from the user. This example also changes the form background to red.
Use to mask the entry and return a secure string.
Type: SwitchParameter
Parameter Sets: secure
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
Set the form background color. You can use a value like 'red' or a '#c0c0c0'.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: White
Accept pipeline input: False
Accept wildcard characters: False
Enter a prompt. No more than 50 characters.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: "Please enter a value"
Accept pipeline input: False
Accept wildcard characters: False
Enter the title for the input box. No more than 25 characters.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: "User Input"
Accept pipeline input: False
Accept wildcard characters: False
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/