I need to get a very long string input (around 9,000 characters), but Read-Host will truncate after around 8,000 characters. How can I extend this limit?
How can I increase the maximum number of characters read by Read-Host?
820 Views Asked by xinglong At
1
There are 1 best solutions below
Related Questions in POWERSHELL
- How to ignore warning errors?
- Data execution plan ended with error on DB restore
- Powershell Split a file name
- PowerShell EWS Save as for e-mails
- Run SQL Server Update Statement With Powershell
- using a global variable in multiple functions powershell
- Heisenberg was here: Aliases for PowerShell parameters only appear in cmdlet help when you do NOT document the cmdlet
- PowerShell Script to add newuser
- Why is PowerShell "not recognized" when installing Chocolatey?
- Enumerate a PSCustomObject as key/value pairs
- Unable to start program outside Windows folder
- Ask for creds only if some specified
- PowerShell 3 Parameters
- i can't ping a computer but remoting into it works (powershell enter-pssession)
- Feeding Variables in new-aduser -path option in powershell
Related Questions in USER-INPUT
- Does closing Scanner affect performance
- Handling RuntimeExceptions in certain circumstances valid?
- Standard way of retrieving PHP Form Inputs
- java print a triangle
- UITextField Caret stops moving around when too large
- Encription Output beautifier
- Java to C++ syntax
- Advancing text in a text file using user input
- The logic is always failing
- Take each character in a string and convert it to Hex c++?
- Batch Getting & Displaying User Input
- Running Python clicker based on keylogger inputs on the background in Windows
- Open a file from user input in python 2.7
- jsPlumb - adding a string value to an edge
- C++: getline is beings skipped for user input
Related Questions in PROMPT
- What's wrong with my decoder? Why does it freeze after prompting the user?
- adding text after prompt for input
- WINDOWS PROMPT Getting IP of webpages from file
- how to reject duplicate values
- Java: Add Place Holder on JTextField
- Getting adresses of webpages IP windows prompt
- Remove text+ pattern from txt file
- Why my gdb prompt shows wrong after I change its color
- How to prompt an SQL query user to input information
- How to write a javaScript function to enter 2 numbers through prompts and display the sum of those numbers in an alert?
- Set up path on prompt on pycharm terminal windon
- No 'prompt' module
- Ansible - when conditional not working for vars_prompt at playbook level
- How to make the raw_input prompt automatically read a string from a previous list?
- PyCharm ignores debugging breakpoints in interactive prompt
Related Questions in CONSOLE-INPUT
- In Go, is it possible to write to the console and read back?
- Internals of ncurses: console input
- <C#> The characters like "ä", "ö" or "å" drop out of the console input
- Console only recognizes second input Java
- How to make the console accept input from the Enter key only?
- Input line from Scanner object gets printed before official print command
- Console I/O : printf & scanf not occurring in expected order
- Java: The right way to make a scanner
- Java Multi-Line Console Input and Cursor Handling
- Prompting for user input as part of a reference to an out-of-script function in R
- Run Java Console Input as Statement
- Getting console input with win32 api in x86 assembly
- Create random generator to make and count odd even pairs of numbers
- How to check for command line argument and if none, prompt for input through console?
- What happens when I use javaw to run the java program in the following scenario?
Related Questions in READ-HOST
- Is there a way to get user input to Powershell's Read-Host from PHP?
- Powershell: Read-Host to select an Array Index
- Powershell menu that loops when the script is launched via PSEXEC (with display return via CMD)
- Powershell Script to get list of local admins on multiple remote PC's
- Automate PowerShell Response to prompt
- Is there any way or method to figure out my mistake to get solution for this command?
- Changing a variable based on output
- Powershell Multiple string read-console
- Read-Host list of filenames and then export the Input to a csv file
- Read-Host Printing the data if the input is given from file | Ubuntu 16
- How do I check if a password in a System.Security.SecureString is empty?
- Powershell Get-mailboxdatabase and Create Shared Mailbox Script
- Do Until loop by Restricting user input to email address or domain\ID in PowerShell using Read-Host
- Autocomplete with TAB Read-host
- [string[]] Parameter vs Read-Host behaviour
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
The following are possible workarounds. Workaround 1 has the advantage that it will work with PowerShell background jobs that require keyboard input. Note that if you are trying to paste clipboard content containing new lines, Read-HostLine will only read the first line, but Read-Host has this same behavior.
Workaround 1:
Workaround 2:
Workaround 3:
More discussion here:
Console.ReadLine() max length?
Why does Console.Readline() have a limit on the length of text it allows?
https://github.com/PowerShell/PowerShell/issues/16555