Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PowerShell Error The command line is too long

I am working on PowerShell script that requires me to pass string as param. The string is a comma seperated list of user names. I get the error when i have 100+ user names. But i get no error if the string has less then 100 users. See below. I have tried to pass this value using array with no luck. What is the character limitation for this param and how can i solve this. I am using this in ServiceNow Run PowerShell script. That value of the parameter is passed by ServiceNow using a comma seperated value.

Param(
    [string]$itil_users_a = "A.Syafiq,Aaron.Brown,Aaron.Reynnie,Abd.Jalil,Abdu.Hijazi,Abdul.Onny,Abdullah.Ammar,Abel.Muataco"    
    )
like image 785
deshergan Avatar asked Oct 27 '25 02:10

deshergan


1 Answers

You may be running into the maximum length for command lines - 8191 chars. See this KB article on max command line length.

like image 197
Keith Hill Avatar answered Oct 29 '25 05:10

Keith Hill