PowerShell Scripting Troubles

Ask your 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.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
Ginenima
Posts: 1
Last visit: Thu Mar 28, 2019 3:07 am

PowerShell Scripting Troubles

Post by Ginenima »

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
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: PowerShell Scripting Troubles

Post by davidc »

[TOPIC MOVED TO WINDOWS POWERSHELL FORUM BY MODERATOR]
David
SAPIEN Technologies, Inc.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: PowerShell Scripting Troubles

Post by jvierra »

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.
This topic is 5 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked