Created
April 24, 2012 17:12
-
-
Save colinbull/2481599 to your computer and use it in GitHub Desktop.
Find is a process is .NET
This file contains 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
let processes = System.Diagnostics.Process.GetProcesses() |> Array.filter (fun p -> p.ProcessName.StartsWith("Raven")) |> Seq.head | |
let ofEnumerator (enum : System.Collections.IEnumerable) : seq<'a> = | |
let en = enum.GetEnumerator() | |
seq { | |
while en.MoveNext() do | |
yield en.Current :?> 'a | |
} | |
let isNet = | |
processes.Modules | |
|> ofEnumerator | |
|> Seq.exists (fun (s : System.Diagnostics.ProcessModule) -> s.ModuleName.Contains("mscorlib")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment