This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.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 | |
-------- ------------ --------- ------------- ---------- ----- ----------- --- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Collections; | |
namespace Xcud | |
{ | |
/// <summary> | |
/// Simple command line argument parser. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Writes a string to a PDF via Microsoft Word automation | |
.Example | |
PS> ps | out-string | out-pdf -Path ".\processes.pdf" | |
#> | |
function Out-PDF() { | |
param( | |
[Parameter(Mandatory=$True, Position=0, ValueFromPipeline=$true)] $Text, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Extend Get-Content to include a -Fast parameter; much less flexible but more performant | |
.Example | |
PS> (Measure-Command { Get-Content .\data.xml} ).TotalMilliseconds | |
1609.3267 | |
PS> (Measure-Command { Get-Content .\data.xml -Fast} ).TotalMilliseconds | |
39.2511 | |
#> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.Synopsis | |
Demonstrate built-in Verbose support | |
.Example | |
PS> Correct-Example -Verbose | |
VERBOSE: This works | |
PS> Incorrect-Example -Verbose | |
PS> Incorrect-Example2 -Verbose |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Management.Automation; | |
using System.Management.Automation.Runspaces; | |
using System.Reflection; | |
namespace Xcud.Net | |
{ | |
/// <example> | |
/// DynamicWebServiceProxy proxy = new DynamicWebServiceProxy(uri); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using Mono.Options; | |
namespace xcud | |
{ | |
public class AttributedOptionSet : OptionSet | |
{ | |
public static T Parse<T>(string[] args) where T : AttributedOptionSet, new() | |
{ |
OlderNewer