Kamen Yotov
Sunday, August 20, 2006
Custom Built Toyota Matrix 2003 CarPC

I have had a CarPC in my Toyota Matrix 2003 for about a year now. I decided it is about time for me to write something about it, help people who are struggling with this endeavor right now, and ask if somebody has solutions to any of my problems. I will start with a more general outline message and if time allows I will be posting more specific messages regarding the different components.

Here are the major components that are currently in it (along with the places I got them from and the price I paid):

This is all for now on this thread. Hopefully I will be extending it in the near future... Some things on the list are pictures of the actual setup, future directions, etc.

Enjoy!

P.S. Special thanks to Rob Lund (http://www.electrolund.com) for providing Toyota Matrix 2003 Wiring Manual! Saved me quite a few hours!

 
Tuesday, August 15, 2006
Developing and Debugging for Windows PowerShell

Here I include a few tips about debugging Windows PowerShell cmdlets and providers. I only do this because I had to "discover" these myself, since the PowerShell documentation only says how to develop extensions from the command line.

I use Visual Studio 2005, create a C# .NET Class Library project, and add a project reference to System.Management.Automation (if you need to browse for the file, it is normally at 'C:\Program Files\Windows PowerShell\v1.0 System.Management.Automation.dll').

The online help at MSDN is kind of broken for PowerShell examples... you have to get the July CTP Windows SDK from here.

Once you are up and running, you can build your PowerShell SnapIn inside the IDE, then you can register it with PowerShell, then you need to attach the IDE debugger to PowerShell (Debug/Attach to process...), set your break-points at the right places and fire your cmdlet / provider from PowerShell... You can then step through your code in the IDE.
 
Saturday, August 12, 2006
IPropertyCmdletProvider and its GetProperty method

The IPropertyCmdletProvider Windows PowerShell interface and particularly its GetProperty method have poor documentation (here and here).

The second source mentioned above also gives the following (wrong) example:
public void GetProperty(
    string path,
    Collection providerSpecificPickList)
{
    PSObject PShObject = new PSObject();
    PSObject.AddNote(propertyName, propertyValue);
    WritePropertyObject(propertyValue, path);
}
Fortunately there is a hint that the standard FileSystemProvider implements the IPropertyCmdletProvider interface. Looking at the disassembly of "C:\Program Files\Windows PowerShell\v1.0\System.Management.Automation.dll" (where FileSystemProvider lives), one can conclude that the above example should in fact be:
public void GetProperty(
    string path,
    Collection providerSpecificPickList)
{
    PSObject o = new PSObject();
    o.Properties.Add(new PSNoteProperty(name, value));
    WritePropertyObject(o, path);
}
I hope you find this information useful! Keywords: Windows, PowerShell, Provider
 

ARCHIVES
August 2006 /


Powered by Blogger

 View...