I have a backup script which is causing me some consternation and would be grateful for some input / help.
The script is a loop that cycles through files in a folder, compresses and encrypts them. I use this script across a number of sites and it works in all but two and I cannot see why it's failing at 2. The code runs, the file name is created but the file size stays at zero and the script never moves on. The CPU isn't being taxed so it's just stuck.
These are the same constants across all the sites
- 7 Zip Module installed in Power shell using Install-Module -Name 7Zip4PowerShell -Verbose
- Server OS is 2016 Standard
The code is below.
cd $TargetFolderdir | ForEach-Object { & "C:\Program Files\7-Zip\7z.exe" a -p"$SQLKey" -tzip ($_.Name+".zip") $_.Name }
I have tried running it as a user, domain admin and local admin. I'm hoping I have missed installing a module somewhere.
Thanks