I have a problem with one script. This is my first time working on powershell. I want to write a script, which can be put in Autostart folder to refresh a VBA Library every time, the computer turns on. The problem is, that I am downloading the file from sharepoint, and while I update it using the code below, it says that file is corrupted. As I read on the internet, it seems that out-file saves it as a txt. Can it be done in some other way?

powershell -Command "Invoke-WebRequest https://xxx/VBAAddin.xlam -OutFile C:\Users\xxx\AppData\Roaming\Microsoft\AddIns\VBAAddin.xlam"

0 Answers