Browse by Tags

All Tags » .net (RSS)

PowerShell: Threading Enhancements FTW!

To build on the threading library I mentioned here , I've added some functionality to make it easier to communicate with the seperate thread. Still, keep in mind that PowerShell will only allow one pipeline to be executing in a runspace at any given time...
Posted by adweigert | 4 comment(s)
Filed under: ,

PowerShell: Threading for PowerShell v1.0

Ok, so this solution really isn't threading, but a neat way to get async scripts to run! The important thing to remember is that each "thread" is actually a PowerShell "runspace". Meaning, scripts run within the thread don't have access to objects or...
Posted by adweigert | 3 comment(s)
Filed under: ,

Windows Server 2008 / Vista - Network Scalability "Feature"

I highly recommend, if you are running Windows Server 2008 or Windows Vista, to disable the network scalability features. If you don't, you run the chance of one day running into "slow" performance of an application between one client or server and another...

C#: My First Lambda Expression

I don't know about anyone else, but I found it annoying to have to put on three-lines of code (or one ugly one-line of code) for an IF statement for argument validation. Mostly, I want to check a simple condition and if true, throw an exception. Well...
Posted by adweigert | 5 comment(s)
Filed under: , ,

C#: My First Extension Method

I will find many, many uses for this ... maybe someone else will too! using System; using System.Diagnostics; internal static class StringExtensions { public static T ToEnum<T>( this string value) where T : struct { Debug .Assert(! string .IsNullOrEmpty...
Posted by adweigert | 1 comment(s)
Filed under: , ,

PowerShell: Try...Catch...Finally Comes To Life

So, PowerShell has some good error handling, but being so used to .NET, I really missed my Try...Catch...Finally statements. Especially when I needed to make sure a block of code always executed. Well, after some playing, I think I have the solution! I've tested this function in a few different ways. I hope this turns out to be as helpful to someone else as it is for me. Maybe Microsoft will add this functionality to the core of PowerShell....
Posted by adweigert | 8 comment(s)
Filed under: ,

PowerShell: Using PowerShell to Debug .NET Class Libraries

PowerShell is so wicked cool. I love it more and more each day I use it. Latest trick is using it to debug or my class libraries without having to have a supporting unit test or console project. Though this method of testing / debuging process isn't as...
Posted by adweigert | with no comments
Filed under: , ,

PowerShell: Convert Active Directory IADSLargeInteger to System.Int64

This PowerShell function will convert an IADSLargeInteger ComObject to a long/Int64 value. Extremely helpful when trying to work with Active Directory attributes like "pwdLastSet" or "lastLogonTimestamp". function ConvertADSLargeInteger...
More Posts