1

I'm trying to call mqsiprofile from a powershell script and it is successful. However, when i run other mqsi commands like mqsilist or mqsicreatebroker, I am getting the below error:

The user environment was not adequately prepared to continue execution. Locate and run the profile supplied with the product. This file is called mqsiprofile, and is located in the bin subdirectory for the product.

I have the windows environment variable PATH set to the bin directory where mqsiprofile command lies.

I tried the same from windows command prompt and all the commands were successful. It seems like the environment is not being persisted after the command execution in powershell.

Any suggestions?

4
  • 1
    Review this answer "How can I source variables from a .bat file into a PowerShell script?", you also have the option writing a batch file wrapper that would first call mqsiprofile then call the powershell script since the powershell script will inherit the environment variables set before the batch starts powershell. Commented Jan 30, 2019 at 9:29
  • Possible duplicate of How can I source variables from a .bat file into a PowerShell script? Commented Jan 30, 2019 at 9:30
  • Hello, IIB profile on windows is apparently not working on PowerShell. I havn't found any record of someone who used power shell for IIB commands, there is already a topic opened on the IBM forums, but no one got the answer : mqseries.net/phpBB2/… I would recommend you to simply launch "iib.cmd" and then use bat or other scripts running with the cmd. Commented Feb 8, 2019 at 7:10
  • I kept searching, and apparently this issue is quite simple : you need to load the profile before launching PowerShell : mqseries.net/phpBB/… Commented Feb 8, 2019 at 7:47

2 Answers 2

2

If you use windows then execute this command to load mqsiprofile and you can use the IIB toolkit

C:\Windows\System32\cmd.exe /T:0A /K "title IBM Integration Console 10.0.0.3 & cd C:\Program Files\IBM\IIB\10.0.0.3\ & IIB.cmd"

Now you can use mqsideploy, mqsicreatebar, mqsiapplybaroveryde and other binaries.

If it is necesary you change the directory of the IIB toolkit, I use C:\Program Files\IBM\IIB\10.0.0.3\

Sign up to request clarification or add additional context in comments.

2 Comments

Please answer in English while you're on the English version of StackOverflow. Thank you.
"will" does not make sense where you added it. I think it sounded good with out "will".
0

Faced this problem when invoking mqsideploy using ant build script in Jenkins with IBM Integration Bus v10. Cr T's answer helped. Rather than copy the line, it is better to take the actual command invoked, which can be found in the properties of the shortcut icon corresponding to the IIB Console.

In addition to the suggestion, the following was done. Created a simple batch file and chained the required command to be invoked which in this case was mqsideploy. This can further be developed so that the ant script passes the variables to the batch script.

The batch script contained the following line (The color and title was dropped for simplicity )

C:\Windows\System32\cmd.exe "cd C:\iib\ & IIB.cmd & mqsideploy -i localhost -p 4414 -e default -a C:\wks\bardir\TestApp-11.bar -m"

The batch was then invoked from Jenkins as another build step. This worked.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.