PowerShell Scripting Troubles

Ask your Windows PowerShell-related questions, including questions on cmdlet development!
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
Ginenima
Posts: 1
Joined: Thu Mar 14, 2019 10:12 am

PowerShell Scripting Troubles

Post by Ginenima » Thu Mar 14, 2019 4:20 am

I'm trying to run a PowerShell script within a bundle uninstall process, and something about this particular script keeps blowing-up with "An error occurred while executing the program." Works just fine from the CLI and from the ISE; I think I need a new set of eyes to look at this one:

Code: Select all

Action Name: Run Script

General

Script to Run: Define your own script
Script content: Get-Process "*Skype*" | Stop-Process -Force
Script file extension: .PS1
Path to Script Engine: ${WinSysDir}\WindowsPowerShell\v1.0\Powershell.exe
Script Engine Parameters: "-executionPolicy Unrestricted -File " (Quotes added to show whitespace)

Wait before proceeding to next action: When action is complete 

Advanced

Working Directory: 
Success Return Codes: 
Priority: Normal
Executable security level: Run as secure system user (Don't allow system to interact with desktop)

User avatar
davidc
Posts: 5913
Joined: Thu Aug 18, 2011 4:56 am

Re: PowerShell Scripting Troubles

Post by davidc » Thu Mar 14, 2019 7:09 am

[TOPIC MOVED TO WINDOWS POWERSHELL FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.

jvierra
Posts: 13893
Joined: Tue May 22, 2007 9:57 am
Contact:

Re: PowerShell Scripting Troubles

Post by jvierra » Thu Mar 14, 2019 7:15 am

My first reaction is to ask why do you need to do this?

When you connect with any mechanism the kb ticket is added to you set. It is not returned to you in any way.

To run a script with credentials just create the package to use the alternate credentials.

Locked