This project is read-only.

Error when adding file to zip (PowerShell)

Dec 23, 2009 at 9:55 PM

I'm running the following (very simple) code in Powershell V2 CTP3:


$zip =  new-object Ionic.Zip.ZipFile



I'm getting the following error:

Exception calling "AddFile" with "1" argument(s): "Request for the permission of type 'System.Security.Permissions.File
IOPermission, mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed."
At F:\Scripts\zip\1.ps1:5 char:13
+ $zip.AddFile <<<< ("F:\Scripts\zip\uncompressed.txt");
    + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : DotNetMethodException

I'm running the newest version of DotNetZip. I'm not sure where the permissions issue lies. I've gone so far as to give "Everyone" full rights to try to get it to work.

Dec 24, 2009 at 2:19 PM

I don't know, but if I Were you I would run ProcMon from sysinternals and see which file is getting the exception, and why.

Is there a larger stack trace? A way to get a larger stack trace?