PowerShell script not zipping correct files
Pass the files as full paths to the Zip function, using their .FullName property (PSv3+ syntax): Zip C:\Users\Admin\Desktop\TEST.zip $Files.FullName The problem is that, in Windows PowerShell, the [System.IO.FileInfo] instances returned by Get-ChildItem situationally[1] stringify to their file names only, which is what happened in your case, so your Zip function then interpreted the $toBeZipped values … Read more