title: How to use interopPermission on batch job script execution
body: <p>I'm trying to run a powershell script through batch job, I used the following code that works fine in a job : </p>
  
  <pre><code>System.Diagnostics.Process  process;
  System.Diagnostics.ProcessStartInfo startInfo;
  ;
  process = new System.Diagnostics.Process();
  startInfo = new System.Diagnostics.ProcessStartInfo();
  startInfo.set_FileName("powershell.exe");
  startInfo.set_Arguments("D:\\Documents\\OP3_FTP_Upload.ps1");
  
  startInfo.set_UseShellExecute(false);
  startInfo.set_RedirectStandardError(true);
  process.set_StartInfo(startInfo);
  process.Start();
  </code></pre>
  
  <p>when I use this code in a runbasebatch class, I have the following errors:</p>
  
  <pre><code>Failed to request the permission of type 'InteropPermission'.
  Unable to create object 'CLRObject'
  </code></pre>
  
  <p>So I try to use the following to solve my permission problem:</p>
  
  <pre><code>Set               permissionSet;
  InteropPermission interopPermission;
  ;
  interopPermission = new InteropPermission(InteropKind::ClrInterop);
  permissionSet =  new Set(Types::Class);
  permissionSet.add(interopPermission);
  CodeAccessPermission::assertMultiple(permissionSet);
  
  ...my first code example
  
  CodeAccessPermission::revertAssert();
  </code></pre>
  
  <p>When I execute my batch job , I have no error message but nothing happens. The path is correct, the script also (parms corrects based on AOS)
  I think the problem is my way to implement permissionSet and interopPermission classes, I know how to use it in case of CRUD operations on files, but how to use it in case of script execution? Can anyone explain me how (if possible)to manage those classes in my case of use?</p>
  
  <p>Any other ideas to solve my problem are welcome.</p>