Getting unexpected at this time ERROR in executing multiple CLI command on powershell
Issue
- On Windows 2012 R2 Datacenter with JBoss EAP 6.4 we have some trouble with
jboss-cli.batscript. If we usejboss-cli.batto execute multiple commands, comma seperated on command line (CMD) like following example then everything is ok.
O:\>o:\JBossEAP6\bin\jboss-cli.bat --connect --commands="/core-service=management/access=authorization/role-mapping=test:add(),/core-service=management/access=authorization/role-mapping=test:remove()"
{
"outcome" => "success",
"result" => undefined,
"server-groups" => {"main-server-group" => {"host" => {"master" => {"server-one" => {"response" => {"outcome" => "success"}}}}}}
}
{
"outcome" => "success",
"result" => undefined,
"server-groups" => {"main-server-group" => {"host" => {"master" => {"server-one" => {"response" => {"outcome" => "success"}}}}}}
}
- But if we use Powershell we are getting the below ERROR:
PS O:\> o:\JBossEAP6\bin\jboss-cli.bat --connect --commands="/core-service=management/access=authorization/role-mapping=test:add(),/core-service=management
/access=authorization/role-mapping=test:remove()"
/core-service was unexpected at this time.
PS O:\> cmd.exe /c o:\JBossEAP6\bin\jboss-cli.bat --connect --commands="/core-service=management/access=authorization/role-mapping=test:add(),/core-service
=management/access=authorization/role-mapping=test:remove()"
/core-service was unexpected at this time.
- Above CLI commands are example commands. Every time we get the above ERROR
was unexpected at this time.On JBoss EAP 6.3.3 there was no such issue.
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 6.x
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
