Skip to content

Instantly share code, notes, and snippets.

View nylyst's full-sized avatar

Eric nylyst

  • Eurofins Lancaster Labs Environmental
  • Lancaster, PA, USA
View GitHub Profile
@nylyst
nylyst / RegisterDLL.ps1
Last active August 1, 2020 16:38
Powershell to register a dll without regsvr32.exe
$registerDLL = @"
namespace RegisterDLL {
using System;
using System.Runtime.InteropServices;
public static class Kernel32 {
[DllImport("kernel32", SetLastError=true, CharSet = CharSet.Ansi)]
public static extern IntPtr LoadLibrary([MarshalAs(UnmanagedType.LPStr)]string lpFileName);
[DllImport("kernel32", CharSet=CharSet.Ansi, ExactSpelling=true, SetLastError=true)]