Start-Process fails with `EnvironmentBlockTooLong` error
See original GitHub issueIt seems that Start-Process has a hardcoded limit for the environment block, which I am hitting when running in Azure Pipelines (which sets lots of environment variables)
According to the documentation this limit only existed for Windows XP, is there any reason for it to remain?
Steps to reproduce
Start-Process -FilePath "myprocess.exe"
Expected behavior
Process is executed
Actual behavior
2020-11-17T14:21:34.1311704Z Start-Process : EnvironmentBlockTooLong
2020-11-17T14:21:34.1313656Z At C:\Program Files\PowerShell\Modules\PSDeployTools\1.1.55\Functions\Invoke-Process.ps1:44 char:16
2020-11-17T14:21:34.1315142Z + $process = Start-Process @processParams
2020-11-17T14:21:34.1316243Z + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2020-11-17T14:21:34.1317681Z + CategoryInfo : NotSpecified: (:) [Start-Process], InvalidOperationException
2020-11-17T14:21:34.1319184Z + FullyQualifiedErrorId : System.InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:13 (3 by maintainers)
Top Results From Across the Web
"The environment block used to start a process cannot be ...
The environment block used to start a process cannot be longer than 65535 bytes. The proejct is alive so yes - we surely...
Read more >Build fails because the environment block used to start a ...
InvalidOperationException : The environment block used to start a process cannot be longer than 65535 bytes. Your environment block is 67476 ...
Read more >The environment block used to start a process cannot be ...
Pipeline tasks are failing because the environment block is too large. This is happening because all of the configuration variables for the ...
Read more >The environment block used to start a process cannot be ...
The error message indicates there is something up with the machine's environment variables. "Remove some environment variables and try again" Is ...
Read more >What is the maximum size of a process environment block?
The environment block used to start a process cannot be longer than 65535 bytes. Your environment block is 70009 bytes long.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I believe we can remove the limit because Windows XP is out of support.
Since the issue is related to Azure Pipelines I’d ask MSFT team to include the fix in servicing release 7.1.1.
🎉This issue was addressed in #14111, which has now been successfully released as
v7.1.3
.🎉Handy links: