Step 3 proceeds to delete the CSV file AND the ZIP file. I can see this happening as I can see the files appear in explorer, then disappear. I truly do not understand how this is possible.
Both step 2 and step 3 use the same parameter (with double backslashes) for the working directory. I guess this must work as the file is created and also deleted there.
The command to zip the file in step 2 is an expression: " compress-archive " + @[param::outputfilename_as_csv] + " " + @[User::outputfilename_as_zip]
where 'outputfilename' is a timestamped filename using the [System::ContainerStartTime] to ensure the same timestamp is used throughout and the 'as XXX' is the same with .csv or .zip as required.
The command to delete ONLY the csv file is: " remove-item " + @[param::outputfilename_as_csv]
Obviously the 'delete CSV' part is correct, the working directory/filename and 'delete' command all work and successfully delete the CSV file.
But why is it also deleting the ZIP? I don't tell 'remove-item' to process the folder, nor have I included any wildcards. Literally just the one, specifically named file.
Even more strange, if I select the TOP 100k from the view, it works fine, but increase to TOP 500k and suddenly the zip file gets deleted again!
Any ideas?
other info: 'execute process' task is used with 'executable' set to 'C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe'
Am using SSDT 2015
It was not deleting both files. The ZIP creation crashes, despite it being well under the powershell 2GB limit, and no zip file is ever left behind.
The end result was that it appeared to delete both files.