I still seem to have a problem with the commit called "Fixed zip issue + using NAA to identify LUNs".
The addition of the CSV files to the ZIP files was hanging.
It seems that the MoveHere method doesn't always delete the file after it was added to the ZIP file.
I tried an alternative by looking at the number of files in the ZIP file, and that seems to work (for me).
But I'm not 100% sure if this is a foolproof solution either, since I couldn't determine if the Count is updated before or after the file is added to the ZIP file !
Anyway, this is the Create-ZipFile function that worked for me.
FunctionCreate-ZipFile { Write-Host"Adding files to"$csvReportName
$zipFileName=$global:desktopPath+$csvReportName
if(Test-Path-Path$zipFileName){ Remove-Item-Path$zipFileName-Force
} set-content$zipFileName ("PK"+ [char]5+ [char]6+ ("$([char]0)"*18)) $zipFile= (new-object-comshell.application).NameSpace($zipFileName) Foreach ($csvfilein (Get-Childitem-Path ($global:desktopPathDir+"*") -Include ("*.csv","*.txt"))) { Write-Host"..$($csvfile.name)"
$zipfileCount=$zipFile.Items().Count
$zipFile.MoveHere($csvfile.fullname) # Wait till the file is added to the ZIP archive while($zipFile.Items().Count-ne ($zipfileCount+1)){Start-Sleep-Milliseconds500} $zipfileCount=$zipFile.Items().Count
} Write-Host"Successfully created $($global:desktopPath)$csvReportName now upload this file to http://vOpenData.org"
Remove-Item-Recurse-Force$global:desktopPathDir
}