Sending Multiple Required Files To Asset

Recently a client asked us to push 40 files out to a bunch of assets.
This was time sensitive so we did this task manually.
Uploaded the 40 files to Script Files.
Created new script and added the 40 required files and the full file paths for each.
This was mind numbing and time consuming so the question - is there a better way?

You could have zipped them up and unpacked them on the systems using expand-archive. Here’s an example of our BD installer, you could substitute it for a required file, but this one downloads from our dropbox.

Import-Module $env:SyncroModule
$DownloadURL = "https://www.dropbox.com/s/randomstring/epskit_x64.zip?dl=1"
$DownloadLocation = "c:\temp"

        Invoke-WebRequest -Uri $DownloadURL -OutFile "$($DownloadLocation)\epskit_x64.zip"
        Start-Sleep -s 120
        Expand-Archive "$($DownloadLocation)\epskit_x64.zip" -DestinationPath $DownloadLocation -Force
2 Likes

Thanks Jimmie,

I had thought about zipping all the files but I didn’t know there was a zipping cmdlet to unzip.
I will be playing around with this in future Microsoft.PowerShell.Archive Module - PowerShell | Microsoft Docs