/build/static/layout/Breadcrumb_cap_w.png

Push Powershell Online Shell Script?

I would like to run a powershell script with the K1000. I have the powershell script as a dependency, and the Script Text as

powershell.exe -executionpolicy unrestricted -file "script.ps1"

I named the script script.bat

When I run the script I receive the following dialog:

2011-10-25 15:09:18: Alert not enabled, moving to next phase....
2011-10-25 15:09:24: Sending script script.bat to client....
2011-10-25 15:09:29: Script sent
2011-10-25 15:09:29: Sending dependency script.ps1 to client....
2011-10-25 15:09:36: Dependency sent
2011-10-25 15:09:36: Executing script....
2011-10-25 15:09:59: Error 1 received while executing script

Does anybody know what error 1 means in this context? Has anybody been able to execute powershell scripts by any other method?

0 Comments   [ + ] Show comments

Answers (8)

Posted by: GillySpy 13 years ago
7th Degree Black Belt
0
Is that debug logging?

Did you test calling this batch (which calls your powershell) from a command prompt running as SYSTEM outside the kbox?
Posted by: muebel 13 years ago
10th Degree Black Belt
0
The log came from the Run Now Status run failures log.

I am able to run the batch as local system without any issue.
Posted by: cmccracken 13 years ago
Orange Senior Belt
0
I included a powershell script in one of my MIs. In the setup.bat I have:

::Allow powershell scripts to run
powershell Set-ExecutionPolicy RemoteSigned

::Set Sort Memory
IF EXIST "C:\Windows\SysWOW64" (
powershell .\x64.ps1
) ELSE (
powershell .\x86.ps1
)

Casey
Posted by: muebel 13 years ago
10th Degree Black Belt
0
MI = Machine Image?

Have you pushed out any powershell scripts?
Posted by: jrscribner 13 years ago
Purple Belt
0
I ran into this once and the problem was a space in one of the directories messed up the path to the powershell script so the script was never executed, my solution was to call the Powershell EXE directly with the following settings:

Launch a program:
Directory: C:\Windows\System32\WindowsPowerShell\v1.0
File: PowerShell.exe
Parameters: -nologo -executionpolicy bypass -noprofile -file "$(KACE_DEPENDENCY_DIR)\PowerShellScript.ps1"
Posted by: cmccracken 13 years ago
Orange Senior Belt
0
MI = Managed Install.

Casey
Posted by: muebel 13 years ago
10th Degree Black Belt
0
Thanks for the tip jrscribner.

I configured an online shell script with the powershell script as a dependency, and the batch script as:

C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -nologo -executionpolicy bypass -noprofile -file "$(KACE_DEPENDENCY_DIR)\script.ps1"

When I did this I received a new error:
2011-10-25 19:40:49: Executing script....
2011-10-25 19:40:55: Error 4294770688 received while executing script

When I set up the Online KScript as you described... and I seem to have had the same behavior with any way I set it up, I run the script and it just hangs at "status pending"

But yeah, error 4294770688... uh google had nothing to say on that one. Anybody have any idea for the source of this particular error code?

Comments:
  • hope you already solved it until now. But the Error Code "4294770688" is decimal and in hexadecimal the error means 0xFFFD0000 what seems to me to have to do with the execution policy. I'm getting currently an similar error during installation with sccm and am not able to fix it.. - pippo91 8 years ago
Posted by: zookdj 12 years ago
Second Degree Blue Belt
0
Thanks for the tip jrscribner. I was having trouble with an off-line script executing a powershell script. I added quotes around the script path argument, and that fixed it.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ