Forum Discussion
- ghuff2Contributor
You can run powershell scripts as TestedApps. Add it as a generic windows application, here's an example I setup with a simple powershell script, all the powershell script does is use Copy-Item to copy a folder or file to another folder or file (both file paths are passed in as command line arguments through TestedApps).
Then just run and close the TestedApp from the keyword test like you normally would.
- mgroen2Super Contributor
ghuff2 thanks for the info.
It works, you suggested it.
However, it would be even better if the command line parameters could be variable, so that I can run Powershell as a TestedApp, with parameters to be used as Command line parameters.
Example:
I have multiple Powershell scripts which need to be run. Now I need to define a TestedApp for each Powershell script to be run. It would be easier if I can only define 1 Powershell as TestedApp and when calling it in my test I use the script to be run as a parameter.
Don't know if this is already implemented in TestComplete?
- ghuff2Contributor
You can set the command line args through TestComplete scripting, see this article. So you'd just have powershell.exe be saved as the TestedApp and then set the command line arg for a specific script before running the TestedApp.