# \[powershell\]automate the application

**URL:** <https://forums.powershell.org/t/powershell-automate-the-application/10799>\
**Category:** PowerShell Help\
**Created:** [June 11, 2018, 7:37am UTC](https://forums.powershell.org/t/powershell-automate-the-application/10799 "2018-06-11T07:37:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sumith-sudesan](https://avatars.discourse-cdn.com/v4/letter/s/d07c76/32.png) [@sumith-sudesan](https://forums.powershell.org/u/sumith-sudesan)\
**Post date:** [June 11, 2018, 7:37am UTC](https://forums.powershell.org/t/powershell-automate-the-application/10799/1 "2018-06-11T07:37:02Z")

</div>

I have to automate the working of a console application (testapp.exe, written in c++).  
The application have different options:

1. Get computer name
2. List services in machine
3. List running applications in machine

The application shows prompt to enter option after the application starts.

Is it possible to automate the application execution???

---

<div class="post-metadata">

**Author:** ![will-anderson](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/will-anderson/32/234_2.png) [@will-anderson](https://forums.powershell.org/u/will-anderson)\
**Post date:** [June 11, 2018, 7:49am UTC](https://forums.powershell.org/t/powershell-automate-the-application/10799/2 "2018-06-11T07:49:50Z")

</div>

There’s various examples out there using Invoke-Expression to fire cmd.exe based commands. I’d recommend taking a look at some of them. Something like this:

```
Invoke-Expression "mstsc.exe /v:$Connect $dimensions"
```

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:34pm UTC](https://forums.powershell.org/t/powershell-automate-the-application/10799/3 "2024-05-16T20:34:58Z")

</div>

Closed on May 16, 2024, 8:34pm UTC


