Skip to content

Instantly share code, notes, and snippets.

@xcud
xcud / SimpleGAC.cs
Created February 5, 2013 12:58
A simple wrapper for GAC.cs from Microsoft KB Article KB317540
// System.GAC (a .Net wrapper for Fusion) implementation was too messy. Simplified here.
//
// Note, installing an assembly with the REFRESH flag specified does NOT work as advertised.
// Overwriting old GAC'd assemblies must be done manually as implemented below.
//
using System.Reflection;
using System.Text;
namespace Xcud.System.GAC
@xcud
xcud / ParsedArgs.cs
Last active December 12, 2015 04:28
Simple string[] args => Dictionary<string, object> parser
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
namespace Xcud
{
/// <summary>
/// Simple command line argument parser.
@xcud
xcud / Get-NetworkStatistics.ps1
Last active December 12, 2015 03:49
Powershellized netstat
<#
.Synopsis
PowerShellized netstat. Building on Shay Levy's work
Shay Levy's Blog => http://blogs.microsoft.co.il/blogs/scriptfanatic/
.Example
PS> Get-NetworkStatistics skype | ft -AutoSize
Protocol LocalAddress LocalPort RemoteAddress RemotePort State ProcessName PID
-------- ------------ --------- ------------- ---------- ----- ----------- ---
@xcud
xcud / Load-Assembly.ps1
Created January 31, 2013 15:30
Pipeable shortcut for [reflection.assembly]::LoadFrom
<#
.Synopsis
Pipeable shortcut for [reflection.assembly]::LoadFrom.
.Example
PS> dir c:\foo.dll | Load-Assembly
GAC Version Location
--- ------- --------
False v2.0.50727 C:\foo.dll
@xcud
xcud / Get-Assemblies.ps1
Last active February 8, 2024 11:37
Gets a list of the assemblies loaded into memory in the current AppDomain.
<#
.Synopsis
Gets a list of the assemblies loaded into memory in the current AppDomain.
.Example
PS> Get-Assemblies power -NameOnly
Name
----
Microsoft.PowerShell.ConsoleHost.dll
Microsoft.PowerShell.Security.dll