11-04-2016 01:29 PM - edited 03-01-2019 06:23 AM
Hi
Need help .
I want run (Get-UcsCentralServiceProfile) command from ucs director work work using powershell agent.
I have installed in powertool in my one of server and I am trying to pointing ucs driector work flow to power tool installed server .
but i am getting error
(Execute PowerShell Command) failed with error - Command failedError while executing command: java.lang.Exception: Error code: 3, error message: Exception while executing script, selectedContext=<None>
Please let me know how to call a ucs central command from ucs director.
11-29-2016 04:15 AM
Does a simple command like this work: echo "abc" > c:\test.txt
Did you load in your script that you execute the snap in Power Tools?
Example here:Power CLI ESXi Host Profile
Can you use these built in tasks?
Select Global Service Profile
01-16-2017 03:04 PM
It would be nice to see the code in question to make sure it's correct. Also, are you importing the UCS Central PowerTool module into the script? Unless you've done some really good manipulation behind the scenes to auto load all the modules you have on the device, you might have to declare the import of the module in your PowerShell script.
Like a
Import-Module CiscoUcsCentralPS (I know this is from an older version of the UCS Central PowerTool, but it's the one I had in front of me via a script I wrote already.
--j
01-17-2017 04:53 AM
Correct – the modules need to be imported. The power shell agent does not act the same as a user logging in and inheriting certain modules on the fly.
Orf Gelbrich
Check out UCS Director Workflow INDEX<https://communities.cisco.com/docs/DOC-56419> on Cisco Communities Site (Twitter @UCSDGURU)
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide