ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker SupportHow to execute mqsi commands from Powershell

Post new topicReply to topic
How to execute mqsi commands from Powershell View previous topic :: View next topic
Author Message
abinaya
PostPosted: Tue Jun 19, 2018 12:42 am Post subject: How to execute mqsi commands from Powershell Reply with quote

Novice

Joined: 20 Jun 2017
Posts: 17

Hi All

I have IIB Version 10.0.0.8 in windows environment and I want to execute mqsi commands in powershell . After executing mqsiprofile in powershell I am getting error as "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." whenever I try to run any other mqsi command.

But the same steps works for a normal command prompt environment. Any assistance is appreciated., and thanks in advance.


Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.


PS C:\Program Files\IBM\IIB\10.0.0.8\server\bin> . .\mqsiprofile

MQSI 10.0.0.8
C:\Program Files\IBM\IIB\10.0.0.8\server

PS C:\Program Files\IBM\IIB\10.0.0.8\server\bin> . .\mqsilist
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.
PS C:\Program Files\IBM\IIB\10.0.0.8\server\bin>
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 19, 2018 2:47 am Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19701
Location: LI,NY

for the environment variables to stick, I believe you'll have to run mqsiprofile before you run powershell. Powershell treats the environment differently from the normal command line, and you'd have to assign the values using $env:name=value for the variable to stick in the powershell session...

Have fun
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
abinaya
PostPosted: Tue Jun 19, 2018 3:22 am Post subject: Reply with quote

Novice

Joined: 20 Jun 2017
Posts: 17

Hi
Thanks for your reply . I tried setting the environment variable path to the folder where mqsiprofile is there in a powershell script .

Setting environment variable path
Set location -path mqsiprofile.cmd location
.\mqsiprofile
.\mqsilist

Wrapped these in a script and tried to invoke the script from powershell ., but the behaviour is same . Getting the same error text
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 19, 2018 8:16 pm Post subject: Reply with quote

Grand Poobah

Joined: 18 Nov 2003
Posts: 19701
Location: LI,NY

abinaya wrote:
Hi
Thanks for your reply . I tried setting the environment variable path to the folder where mqsiprofile is there in a powershell script .

Setting environment variable path
Set location -path mqsiprofile.cmd location
.\mqsiprofile
.\mqsilist

Wrapped these in a script and tried to invoke the script from powershell ., but the behaviour is same . Getting the same error text

You need to source mqsiprofile before you run powershell...
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
abinaya
PostPosted: Tue Jun 19, 2018 10:03 pm Post subject: Reply with quote

Novice

Joined: 20 Jun 2017
Posts: 17

Hi

can you please elaborate what you mean by "source mqsiprofile" ?

$BROKER_HOME = "C:\Program Files\IBM\IIB\10.0.0.8\server\bin"
$env:PATH =$env:PATH + $BROKER_HOME
Set-Location -Path 'C:\Program Files\IBM\IIB\10.0.0.8\server\bin'
.\mqsiprofile
.\mqsilist

I have this in a script and on execution i get error as 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.
Back to top
View user's profile Send private message
abinaya
PostPosted: Tue Jun 19, 2018 10:13 pm Post subject: Reply with quote

Novice

Joined: 20 Jun 2017
Posts: 17

I tried this too :

$BROKER_HOME = "C:\Program Files\IBM\IIB\10.0.0.8\server\bin"
$env:PATH =$env:PATH + $BROKER_HOME
mqsiprofile
mqsilist

Powershell screen :

PS C:\Users\xxx> ."D:\Scripts\Maintenance\test.ps1"

MQSI 10.0.0.8
C:\Program Files\IBM\IIB\10.0.0.8\server

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.
PS C:\Users\xxx>

mqsiprofile is getting set but its not retained . that is my understanding from the error . How to retain the mqsiprofile
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Page 1 of 1

MQSeries.net Forum IndexWebSphere Message Broker SupportHow to execute mqsi commands from Powershell
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.