How to integrate the copying of files into a Powershell Script Task

I am trying to create a BigFix task that runs a powershell script which -
(1) Copies an XML file from the package to a local path on the target client i.e C:\Temp
(2) Copies an PS1 file from the package to a local path on the target client i.e. C:\Temp
(3) Lastly imports a scheduled task i.e. schtasks.exe /create /TN “Task 1 Name” /XML “C:\Temp\ScheduledTaskToImport.xml” /ru SYSTEM /f

I have created the package via Systems Lifescycle\Software Distribution\Manage Software Distribution and added each of the 3 x associated files so I can create the task.etc
i.e.
-PowershellScriptRunInBigFixTask.ps1
-PowershellScriptSchedTaskRuns.ps1
-ScheduledTaskToImport.xml

How do I copy the files from the package? What is the source path\s?

Thanks in advance

Look at the actionscript generated for you when you created this package. The files are packaged into a BigFix archive file which the actionscript will extract as one of the first steps. The path to the files is the same as the one it calls the “waithidden powershell.exe” with (normally __download of the current directory). You could then just change the actionscript to be:

copy "__download\PowershellScriptRunInBigFixTask.ps1" "\Path\To\Where\You\Want\To\Copy\It\To"
copy "__download\PowershellScriptSchedTaskRuns.ps1" "\Path\To\Where\You\Want\To\Copy\It\To"
copy "__download\ScheduledTaskToImport.xml" "\Path\To\Where\You\Want\To\Copy\It\To"

Thankyou for the response, much appreciated. I will give your suggestion a go and let you know the outcome.

Apologies for another dumb query but does this look ok? Correct formatting for paths? Thanks

Close. You will need to include the filename too as part of the destination,

If you prefer you can just change the value pointed to as baseFolder from “__Download/” to the new path you want to use.

parameter "baseFolder"="C:\Program Files (x86)\BigFix Enterprise\BES Client\"

This will then have the move commands already present in the actionscript just place the files where you wanted them.

As an aside, you might not want to put these directly in the BES Client folder but rather create a new folder to put them in. That way you don’t clutter up the directory with non-application files. Just make sure the folder exists first before attempting to put things into it.

Legend, thanks again Mike