Posts Tagged ‘tips and tricks’

PowerShell Developer Tip: Debugging COM Objects

Here’s a simple way to debug and quickly prototype COM objects with Visual Studio and PowerShell. In the Debug section of the project properties for the COM object, just put in the PowerShell executable. For command line arguments you can then specify the New-Object cmdlet to instantiate the COM object. ┬áThis is the command line […]

Debugging Poor Error Messages in PowerShell v3

The new CIM IDE is great for creating new cmdlets. It is probably one of the reasons that there are so many new cmdlets in Windows 8. The problem I’m starting to see if that these cmdlets behave very poorly. Take for instance the Set-NetAdapterAdvancedProperty cmdlet. When attempting to do the following (research for my […]

Time Zones in PowerShell

Doug Fink wrote an article about getting time zone information in PowerShell awhile back. This helped me out today while I was trying to remember how to construct TimeZoneInfo classes in PowerShell. I was working with a cmdlet (which I had developed…) that accepts a TimeZoneInfo class. Typically I think this is a good idea […]

Export Specific Properties to CSV in PowerGUI

The Export to CSV action in PowerGUI is handy. I’ll use it occasionally to share with other people the results of one of the filters I’ve performed. It does have one annoying little caveat though and that is that it saves everything. You can’t select which properties, or columns, are saved off into the CSV. […]

Building Binary PowerShell Modules – Part 1 – Getting Started

When searching for PowerShell help topics I typically run into a lot of information about using PowerShell. Creating scripts, loading modules and command line tricks. I first started with PowerShell developing the vWorkspace PowerShell module. This module is almost entirely binary. Although there is some information on the topic it’s definitely far and few between. […]

Visual Studio – Lean and Mean

Visual Studio has some serious bloat to it right out of the box. Tack on a few extensions, ReSharper and any number of other add-ons and your machine can be pretty taxed while running Visual Studio. Additionally, context menus and tool bars can expand to the point where it becomes detrimental to productivity. What I’ve […]

PowerShell for Programmers – Automating Code Generation with PowerShell

There is a feature that has been in pretty much every PowerShell host inside Visual Studio and that is the ability to access the DTE (the top level automation object). Here are a couple cool things that you can do using the DTE. I’ll start by defining a couple simple functions for finding code elements. […]

Managed C++, Exceptions and the GetLastError function

I recently modified a project that was unmanaged C++ to utilize the /clr switch to enable CLR support. I studied the side effects of this but didn’t really see anything that would negatively affect the project. It seemed that the gain would outweigh the risk because of having access to .NET right in the C++ […]

Build WDK Drivers in TFS

The WDK does not integrate into Visual Studio natively. It uses different tools to produce the drivers. This makes it really difficult to compile drivers using TFS or other continuous integration systems. Here is a simple way to launch the WDK build process from Visual Studio and TFS build. First, you need to setup for […]

PowerShell Tracing

I spend a lot of time digging around in the System.Management.Automation.dll with Reflector. I love trying to understand how this whole PowerShell thing works. One thing I’ve noticed with PowerShell is that it utilizes the .NET TraceSource class to enable internal logging. Trace sources allow you to tag particular operations with a source and, amazingly, […]