Im really new to PSDT so im not sure how to accomplish this, What I need to do is after installing a MSI I need to start the application so it creates a file in %username%\appdata then overwite the file created . The issue i have is closing the app after i open it. This is what i have is there a command to exit the app? Im having a hard time finding
Execute-Process -Path 'C:\Program Files (x86)\Ontario Systems\Artiva Webstation\Webstation.Client.exe'
Start-Sleep -Seconds 5
## here is where I want to close the exe
Remove-File -Path "$envAppData\Ontario Systems\Webstation\Webstation.Client.config"
Copy-File -Path "$scriptDirectory\Files\User config\*.*" -Destination "$envAppData\Ontario Systems\Webstation"
Execute-Process -Path 'C:\Program Files (x86)\Ontario Systems\Artiva Webstation\Webstation.Client.exe'
Start-Sleep -Seconds 5 #This is not a good idea (BTW) you cannot be sure the setup is complete.
## here is where I want to close the exe
Show-InstallationWelcome -CloseApps 'Webstation.Client' -silent #FYI: I'm guessing on the app name
Remove-File -Path "$envAppData\Ontario Systems\Webstation\Webstation.Client.config"
Copy-File -Path "$DirFiles\User config\*.*" -Destination "$envAppData\Ontario Systems\Webstation" #this is also a bad idea if you use SCCM to deploy.
Try copying the files into the profile BEFORE you run Webstation.Client.exe
If it works, consider using Active-setup to copy those files into the user’s profile.
Since we are doing this blind (no logging), I’m guessing (no logging) the reason Show-InstallationWelcome -CloseApps didn’t show anything is because Webstation.Client is not what is needs to be looking for. Use Get-Process to get the right name.
Hi,
Why you don’t check real application name in Task Manager?
If Show-InstallationWelcome -CloseApps doesn’t kill the APP you have to use native get-process -name “name of the process to kill” | Stop-Process
The think is here process name which must be different from Webstation.Client