HP SUM 6.2 + Powershell - any advise? (394 Views)
Reply
Neighborhood Admin
chuckk281
Posts: 3,082
Registered: ‎01-09-2007
Message 1 of 2 (394 Views)

HP SUM 6.2 + Powershell - any advise?

Kelly was looking to help a customer with scripting in PowerShell (PS):

 

**************

 

Sorry for sending this out without doing some homework on it, but my PowerShell (PS) skills are light and would need more time then I should take before responding to the customer.

 

I have the following request from a customer, who seems to be having issues passing parms to the hpsum.bat file when invoking from PS. He is using PS to accomplish a few other items, then wants to run HPSUM, and then do a few more items when it is done.  The hpsum.bat command + parms works fine if executed directly at a command shell, but not from within PS.  He needs this PS script to be ran on remote servers (running HP SUM against localhost) – hence the comment of “multiple nodes”.

 

This is what he wrote:

 

I'm testing SPP 2014.02.0 which appears to resolve the performance issues that I had with 2013.09.0.  Although, this is my first experience with HPSUM 6.x.  I'm trying to script the install to be deployed to multiple nodes, but I'm having issues with hpsum.bat taking parameters from PowerShell.  Has anyone else experience this and found a way to work with it?

Here is an example of some of the scenarios that I've tried.  They all end in the same error.

1)
PS C:\Install\HPSPP2014020> $arg = "/override_existing_connection", "/logdir $LogDir\HPSPP.$FileTime\"

PS C:\Install\HPSPP2014020> Start-Process -FilePath .\hpsum.bat -ArgumentList $arg

2)

PS C:\Install\HPSPP2014020> "hpsum.bat /override_existing_connection /logdir C:\logs\HPSPP.20140304145" | Out-File Invoke-HPSum.bat -Encoding ascii ; .\Invoke-HPSum.bat

Error: cannot parse the option: /override_existing_connection.

3)

PS C:\Install\HPSPP2014020> & .\hpsum.bat $arg

cmd /c --C:\Install\HPSPP2014020\hpsum.bat-  /override_existing_connection /logdir C:\logs\HPSPP.201403041450-

Error: cannot parse the option: /override_existing_connection.

 

Any suggestions?

 

*************

 

Reply from Aric:

 

***********

 

Your customer needs to pass the arguments as a single string, not an array of strings.  The following is what I use (as a small example).

 

start-process -FilePath ".\hpsum.bat" -ArgumentList "/silent /logdir 'c:\hpvs\logs\spp.log'"  -wait -NoNewWindow

 

***********

 

Other comments or suggestions?

 

Please use plain text.
Occasional Visitor
mojomatt2
Posts: 2
Registered: ‎04-07-2014
Message 2 of 2 (236 Views)

Re: HP SUM 6.2 + Powershell - any advise?

Try adding the /s parameter into your command line.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation