BladeSystem - General
1748060 Members
5427 Online
108758 Solutions
New Discussion

HP SUM 6.2 + Powershell - any advise?

 
chuckk281
Trusted Contributor

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?

 

1 REPLY 1
mojomatt2
Occasional Visitor

Re: HP SUM 6.2 + Powershell - any advise?

Try adding the /s parameter into your command line.