Asked by:
Starting an Application' s CLI and passing commands to it from Powershell

General discussion
-
First, I'm sorry if this has been addressed already, but I could not seem to find a post that "fit" my dilemma.
Also, I want to say that I am a COMPLETE NUBE where PS is concerned, so please respond with that in mind.
The Need:
I need to automate a function to be applied to several targets, hence the desire to script it, to be applied on a schedule nightly.
I have spoken to the vendor of the software (GUI) that we use to manage these targets but they confirm that it is not possible using the GUI.
There is however a CLI as part of the software, and I can perform the function 'manually' from the CLI.
My thought was that I would write a script to perform the function and then use 'Task Manager' to schedule the execution of the script.
The Dilemma:
I cannot figure out how to both launch the Application's CLI, and pass the login, password, domain, and commands to perform the function from the script INTO the new shell running the CLI.
I have tried to write a simple .bat but was unsuccessful. Now I am looking at PS.
Is this possible, please help.
Thanks in advance,
Brandon
Brandon
- Changed type Bill_Stewart Monday, March 12, 2018 9:39 PM
- Moved by Bill_Stewart Monday, March 12, 2018 9:39 PM This is not a support forum for third party software
Saturday, February 10, 2018 12:20 AM
All replies
-
You will have to ask the applications vendor if this is possible and how it can be done. PowerShell as no "magic" ability to do such things it the target application is not designed to accept batch input or to support automations.
\_(ツ)_/
Saturday, February 10, 2018 12:29 AM -
So, to make sure I understand...
The application cli needs to be written in such a way to be "allowed" to accept input from another shell? Then PS would be able so pass the commands to it?
The CLI in question is SGMS, an application by Dell, to manage its Firewalls. It runs when executed inside a CMD window, with it's own set of commands. These would be the commands I need to pass to it.
But it sounds like what I am looking to do is not possible then based on what I think I understand you to have meant in your reply. Bummer.
Brandon
Saturday, February 10, 2018 12:53 AM -
If the commands are executed as command line parameters then just run it a PowerShell prompt just as you would at a CMD prompt.
\_(ツ)_/
Saturday, February 10, 2018 1:26 AM -
We're not able to answer general questions about the capabilities of a vendor's software (particularly when we have zero visibility into the problem) - these are questions you need to ask the vendor.
-- Bill Stewart [Bill_Stewart]
Saturday, February 10, 2018 4:39 PM -
I have contacted the vendor, but as per my original post/inquiry, I was asking about PowerShell's capabilities.
***From Original Post***
"My thought was that I would write a script to perform the function and then use 'Task Manager' to schedule the execution of the script.
The Dilemma:
I cannot figure out how to both launch the Application's CLI, and pass the login, password, domain, and commands to perform the function from the script INTO the new shell running the CLI.
I have tried to write a simple .bat but was unsuccessful. Now I am looking at PS.
Is this possible, please help."
***End Quote***
Sorry if it appeared as though I was attempting to find help for a 3rd party product. Specifically, I was inquiring about whether or not PowerShell could be used in this manner.
Brandon
Sunday, February 11, 2018 3:38 PM -
Only the vendor of the product can answer that question.
\_(ツ)_/
Sunday, February 11, 2018 8:32 PM -
Specifically, I was inquiring about whether or not PowerShell could be used in this manner.
Only the developer of your software can answer that question.
-- Bill Stewart [Bill_Stewart]
Monday, February 12, 2018 3:11 PM