# Application installation issues via PS script

**URL:** <https://forums.powershell.org/t/application-installation-issues-via-ps-script/12639>\
**Category:** PowerShell Help\
**Created:** [May 29, 2019, 2:16pm UTC](https://forums.powershell.org/t/application-installation-issues-via-ps-script/12639 "2019-05-29T14:16:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![andrew-powell](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/andrew-powell/32/217_2.png) [@andrew-powell](https://forums.powershell.org/u/andrew-powell)\
**Post date:** [May 29, 2019, 2:16pm UTC](https://forums.powershell.org/t/application-installation-issues-via-ps-script/12639/1 "2019-05-29T14:16:22Z")

</div>

I am trying to install a package using a PS script through SCCM. The application installs fine but during the installation, the application is launched. The SCCM job will not complete until the application is closed. I want to be able to add some code to my script to shut the application down after installing, so SCCM will show success.

Currently I just have:

start-process -FilePath ‘xxxxx.exe’ -wait

if (get-process ‘xxxx.exe’){  
stop-process ‘xxxx.exe’  
}

It’s a simple install.

---

<div class="post-metadata">

**Author:** ![tethylis](https://avatars.discourse-cdn.com/v4/letter/t/9de0a6/32.png) [@tethylis](https://forums.powershell.org/u/tethylis)\
**Post date:** [May 29, 2019, 4:53pm UTC](https://forums.powershell.org/t/application-installation-issues-via-ps-script/12639/2 "2019-05-29T16:53:21Z")

</div>

I was able to do something like this and have it work:

```
Start-Process -FilePath "C:\Program Files\Mozilla Firefox\firefox.exe"
# Needed to let firefox run before closing

Start-Sleep -Seconds 5

if (Get-Process -ProcessName ‘firefox’) {

```
Stop-Process -ProcessName 'firefox'

```

}
```
  
I think if you reference the actual name of the process with Get-Process and Stop-Process, rather than “name.exe”, it should work a bit better for you. Hope that helps!

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [May 29, 2019, 5:44pm UTC](https://forums.powershell.org/t/application-installation-issues-via-ps-script/12639/3 "2019-05-29T17:44:26Z")

</div>

> [@](#):
>
> … but during the installation, the application is launched.

You should contact the vendor / manufacturer of the software. That’s not a common behaviour for an installation process.

---

<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:32pm UTC](https://forums.powershell.org/t/application-installation-issues-via-ps-script/12639/4 "2024-05-16T20:32:43Z")

</div>


