Skip to main content
Answer

Worklet with an uploaded file

  • May 24, 2023
  • 2 replies
  • 642 views

Forum|alt.badge.img

Hi, I have uploaded a file named “config” to the remediation code, and I want to copy it to the directory "/usr/local/bin"

In the script I tried using :

Copy-Item .\config -Destination “/usr/local/bin”

but it didn’t work.

Could somebody help me ? Thanks in advance !

Best answer by JohnG-Automox

Hi @Ivy!

There’s a worklet in our Catalog named Windows - Configuration - Copy File from Payload that should help with this!

https://console.automox.com/manage/worklet-catalog/244

 

In this worklet, you’ll upload your desired file to the worklet’s payload.  You’ll then need to complete the $filename variable with the name of the file you want to copy to the device, and then $filepath will be the target destination for your file. This should be configured in both the evaluation and remediation code blocks:

 

If you wish to use your code instead, you’ll want to include the full file name, including the file extension. And for the file path, you’ll want to use the absolute file path instead of a relative one.

 

I hope this helps!


Have a great day!

 

2 replies

JohnG-Automox
Forum|alt.badge.img
  • Automox Employee
  • Answer
  • May 25, 2023

Hi @Ivy!

There’s a worklet in our Catalog named Windows - Configuration - Copy File from Payload that should help with this!

https://console.automox.com/manage/worklet-catalog/244

 

In this worklet, you’ll upload your desired file to the worklet’s payload.  You’ll then need to complete the $filename variable with the name of the file you want to copy to the device, and then $filepath will be the target destination for your file. This should be configured in both the evaluation and remediation code blocks:

 

If you wish to use your code instead, you’ll want to include the full file name, including the file extension. And for the file path, you’ll want to use the absolute file path instead of a relative one.

 

I hope this helps!


Have a great day!

 


Forum|alt.badge.img
  • Author
  • Rookie
  • May 25, 2023

Hello !

That works ! Thanks for your help !