My name is Josh Einstein and I am a software engineer living in a Philadelphia suburb in southern New Jersey. I have spent the last 15 years developing applications on the Microsoft development stack. Most of my work experience has been in the telecommunications industry, but I also spent a good five years or so as a self-employed independent software vendor (ISV) and consultant. I developed applications for Tablet PC, enterprise VoIP, and SharePoint just to name a few of my favorite.
I’ll be posting various thoughts, rants, code, questions, etc here so feel free to check back from time to time.

Posts
Hello Josh,
I found your ConvertTo-Dictionary function, found it very smart, it works perfectly.
I can think of a thousand useful ways to use it.
That is why I wanted to put the function in a module of very useful functions.
But then….(after importing the module) the function doesn’t work anymore…
What a pity.
If the function is ‘declared’ in the same session, or if it is part of the same script as where it is used, everything is nice; but if it lives in the module definition it cannot be ‘called’ intact so it seems. The ‘$_’ does not keep its contents or so it seems.
1. Do you understand why?
2. Is there anything we can do?
I would hate it if I would have to dot-source it every time, or copy it into every script, isn’t that what modules are about (among other reasons).
In the meantime: Thanks for you interesting blogs.
Jacques Willemen, Breda, Netherlands
2010-02-24 @ 5:07 pm
Yes I know exactly what you are talking about. Modules have different scoping rules than global functions. I do have a workaround that I use in my LINQ.psm1 module for all of my “selectors” and “predicates”. I will try to post it tonight. It unfortunately involves reflection but it’s wrapped up in a nice cmdlet that can inject variables into the scope of any scriptblock.
2010-02-25 @ 5:58 pm
Okay Jacques, check out the LINQ.psm1 module in my SkyDrive at the following URL:
http://cid-89e05724af67a39e.skydrive.live.com/browse.aspx/PowerShell/Modules/LINQ?uc=2
There’s lots of useful stuff in there but pay particular attention to the Invoke-ScriptBlock function. Notice how it captures the current “underbar” variable, sets a new one, invokes the scriptblock, then restores the old underbar.
Invoke-ScriptBlock is used by practically every other function in that module and they all use the $_ (dollar underbar) syntax to refer to the current item.
I’d be thrilled if this winds up helping you because I literally scanned through thousands of lines of code in Reflector when PowerShell was in CTP just to figure out how to do this! It was extremely frustrating.
2010-02-25 @ 11:46 pm
Hi Josh,
First & short reaction (because it is very late already):
You solved my problem, if I use Linq-ToDictionary instead of ConvertTo-Dictionary the results are perfect (as far as I tested until now). I will write you more tomorrow.
2010-02-26 @ 8:19 pm
Hi Josh, me again,
I was a bit overwhelmed by your massive response to my seemingly simple question. Although of course I understand you did not create that Linq module just because of me. Interesting to find that one of the Powershell Big Guys is struggling with same obstacles as an amateur like me. Difference is, you are the one to find the most elegant kinds of solutions; and I am the one that has to try to understand what can be achieved with them.
I get the impression that Linq (never heard of…) is something I will find of interest (raised mathematician/logician, earning a living as a Windows SysAdmin).
Let’s google for linq.
I see that incidentally you published your LINQ module today, I hope I did not rush you.
Again, thanks a lot, and success further on….
2010-02-27 @ 5:29 pm
Hello Josh,
Josh, are you the same Josh Einstein that was a Tablet PC MVP back in 2007 ????
Could you comment on the following. If you don’t have the time, do you know who
might be able to comment on this?
http://www.tabletpcquestions.com/showthread.php?189984-portrait-screen-calibration-180-degrees-off-%28Gateway-M280E%29
Thanks much
2010-05-04 @ 10:40 pm
Hi Josh! Just wondering if there is any chance you will update TEO for Windows 7 and Outlook 2010? I’ve upgraded and I miss TEO.
2010-08-13 @ 7:32 pm
Hey Kevin. I was just thinking about TEO this morning. The problem is all the API’s have improved since then. Outlook, WPF, .NET etc all have evolved significantly and I’d basically have to rewrite it. I would totally do it but the problem is that I’m swamped at work and to do it right would require a substantial amount of time. Before it was easy. All I had to give up time with the girlfriend. But now I’m married, my son has a claim on at least 2 hours of my day. And of course there’s the 8 hour work day + 3 hours of commuting. Trust me I’m really trying to find a way to make it work. Since I “dropped off the face of the earth” I’ve lost 2 good friends, a ton of credibility, and not least of which, a lot of self-confidence. But in any event, what kind of ideas were you thinking for a new TEO? One thing I’ve always thought about (but never really worked well) was dictating appointments and contacts by speech using a context-sensitive grammar.
2010-08-19 @ 9:26 pm
Good to hear back from you Josh. Family comes first so it sounds to me as if you have your priorities straight even if that means no further updates to TEO. MSFT should have latched on to you when you were in meetings with them several years back. As for your self-confidence, TEO is but one example of your programming abilities let alone the nice family you have so gain that self-confidence back. I bet pretty much anyone that has used your programs wouldn’t want you to put TEO ahead of family and other responsibilities so don’t be hard on yourself.
In terms of TEO, I was simply hoping to get TEO 3 to run with Outlook 2010. I attempted to install it but the installer tells me I don’t have a compatible version of Outlook installed and stops there. I wasn’t sure if TEO 3 was truly incompatible with Outlook 2010 or if it was just a matter of a programming change needed to allow the installer to proceed if Outlook 2010 was installed. Several of my Outlook add-ins seem to work with the 32 bit version of Outlook 2010 so I was just hoping TEO would also.
Thank you for getting back to me and please take care of yourself and family. You’ll find your son grows up so fast it is important to enjoy the moments while you have them. It was great to hear back from you.
2010-08-20 @ 4:04 pm