This project has moved and is read-only. For the latest updates, please go here.

[solved] Powershell script don't work

Topics: Configuration Issue
Apr 5, 2014 at 4:39 PM
Hi Guys,
i've created a customer update package with a powershell script.
The script works fine, if i start it manually:
Copy-Item -Path .\TEST C:\ -Recurse -force
Copy-Item -Path .\WINDOWS C:\ -Recurse -force
The Customer Update log says:
05.04.2014 14:44:08 Running 3 Elements.
05.04.2014 14:44:08 Running CustomUpdateEngine.ScriptElement
05.04.2014 14:44:08 Running ScriptElement.
05.04.2014 14:44:08 Running : C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe With arguments : "copyfiles.ps1" 
05.04.2014 14:44:32 Exiting process with ExitCode = 1
05.04.2014 14:44:32 End of ScriptElement.
05.04.2014 14:44:32 Running CustomUpdateEngine.WaitElement
05.04.2014 14:44:32 Running WaitElement.
05.04.2014 14:44:34 End waiting.
05.04.2014 14:44:34 Running CustomUpdateEngine.ReturnCodeElement
05.04.2014 14:44:34 Return Code Method is : Variable
05.04.2014 14:44:34 Returning :  1
Can everyone write me, how i have to create the customer update with a powershell script?
Apr 7, 2014 at 7:49 AM
Edited Apr 7, 2014 at 7:49 AM
I think you have the 'wrong' path to the script, you'll need:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe With arguments : ".\copyfiles.ps1"

Look at my XML file:
<ElementType>CustomUpdateElements.ScriptElement</ElementType>
<ScriptType>Powershell</ScriptType>
<Filename>.\Java-CleanUp.ps1</Filename>
<Arguments/>
<KillProcess>True</KillProcess>
<TimeBeforeKilling>6</TimeBeforeKilling>
.\ is importent!
Marked as answer by DCourtel on 4/9/2014 at 11:24 AM
Apr 9, 2014 at 9:21 AM
You are right. Now the update works successfully.
Thanks!