title: Registering a .NET DLL with Regasm using Powershell fails
body: <p>With visual studio 2012 I created a DLL file in C# which can be used in Access 2013 by referencing it. This all works fine. I Created the DLL and registered it with CMD doing: <code>RegAsm.exe -tlb -codebase C:\MyFolderX\MyDLL.dll</code></p>
  
  <p>This all works fine, but because the DLL needs to be registered at multiple computers I wanted to do this with 1 click instead of doing it manually at each user computer. </p>
  
  <p>Because users already use a BATCH file to launch the Access frontend application (which uses the DLL) I thought it would be wise to register it once when they use the BATCH startup. So to do this this I added the following in my BATCH script:</p>
  
  <pre><code>cd C:\Windows\Microsoft.NET\Framework\v4.0.30319
  RegAsm.exe -tlb -codebase C:\MyFolderX\MyDLL.dll
  </code></pre>
  
  <p>This sadly doesn't work because it has to be done in admin mode and checking the checkbox run as administrator just jumps through my BATCH code without doing anything for some reason. </p>
  
  <p>So I though, why not use a Powershell script to do the same and launch that from my batch script. </p>
  
  <p>To do this I created the following script:</p>
  
  <pre><code>#Register the assembly
  $RegAsm = 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe -codebase -tlb'
  $Assembly = 'C:\MyFolderX\MyDLL.dll'
  
  Start-Process $RegAsm $Assembly
  
  pause
  </code></pre>
  
  <p>This however keeps giving the error: </p>
  
  <pre><code>Start-Process : This command cannot be run due to the error: The system cannot find the file specified. At C:\users\me\Desktop\RegisterMyDLL.pst1
  
  +Start-Process $RegAsm $Assembly
  
  InvalidOperation: (:) Start-Process
  FullyQualifiedErrorId : InvalidOperationException, Microsoft.Powershell.Commands.StartProcessCommand
  </code></pre>
  
  <p>I double checked the location of the DLL and it it just there.. Anyone have a clue what I am doing wrong? Perhaps some syntax error or quote to much? Already tried to escape my backslashes but this didn't had any effect. </p>
  
  <p>Or perhaps there is an better way to achieve easy DLL registering at multiple users? </p>