Update-TypeData, ISE CTP3 vs ISE RC, and Teched2009 Demos

There were quite a few name changes in the ISE Object Model from CTP3 to RC


Using Update-TypeData, we can achieve some parity between the two


We can add aliases to the CTP3 version to make it look like the RC Version


 For example,


        <Name>System.Management.Automation.Host.PSGHost</Name>
        <Members>
            <AliasProperty>
                <Name>CurrentPowerShellTab</Name>
                <ReferencedMemberName>CurrentOpenedRunspace</ReferencedMemberName>
            </AliasProperty>


Will make $psISE.CurrentPowerShellTab point to $psISE.CurrentOpenedRunspace


Some are more complex, and we can use ScriptPropery


            <ScriptProperty>
                <Name>AddOnsMenu</Name>
                    <GetScriptBlock>$psISE.CustomMenu</GetScriptBlock>
            </ScriptProperty>


In this example, $psISE.CurrentPowerShellTab.AddOnsMenu points back to $psISE.CustomMenu


Some things I couldnt proxy, for example, there is no ‘Maximized’ state in CTP3


With that, I make it silently ignore the request


            <ScriptProperty>
                <Name>SelectedScriptPaneState</Name>
                <GetScriptBlock>$null</GetScriptBlock>
                <SetScriptBlock>$null</SetScriptBlock>
            </ScriptProperty>


To try Dan and I’s Tech-ed demos, http://blogs.msdn.com/powershell/archive/2009/05/19/powershell-session-at-teched-2009.aspx, do


Execute “Update-TypeData -Append c:\path\to\IseRCType.ps1xml”


Execute “. c:\path\to\demo\WindowsPowerShell\Microsoft.PowerShellISE_profile.ps1”


It should add Demo items to the menu


Click on any of the menu items to start the demo


I have tried it on an Vista box running CTP3. Some errors are ignorable, YMMV… Sorry.


For Demo-GUIInstaller, it should open GUIDemo.ps1. Press F7 to move to the next comment, and F5 to run the demo


Hope this helps,


Ibrahim Abdul Rahim


[MSFT]

IseRCType.ps1xml