What happend to Add-UIFunction?

Jun 6, 2011 at 7:36 PM
Edited Jun 6, 2011 at 8:19 PM

I have to fix things like

Add-UIFunction -Type System.Windows.Controls.DataGrid
Add-UIFunction -Type  System.Windows.Controls.DataGridTextColumn
Add-UIFunction -Type  System.Windows.Controls.DataGridHyperlinkColumn
Add-UIFunction -T System.Windows.Forms.FolderBrowserDialog

Add-UIFunction -Type System.Windows.Input.CommandBinding

which are no longer working in the stable release.

I'm working on a Show-UI version of  TryPowerShell  (CommandBinding, FolderBrowserDialog)

I have converted my Skript http://pauerschell.blogspot.com/2011/04/search-for-firefox-bookmarks-with-given.html to search for Firefox bookmarks for combinations of tags

to Show-UI and DataGrid

and I'm trying to convert the GUI stuff from the SQLPSX Tablebrowser with Datagrid is a great improvement.

Please tell me if there are work arounds or if I can hope for a solution in the next release.

Jun 7, 2011 at 7:07 AM

Thanks for noting this.

Add-UIFunction doesn't currently exist in ShowUI.  It's one of a few remaining compatibility bugs we need to address, and we should have it in the July drop.

However, we now also automatically generate a lot of the types we see.  If you run under .net 4.0, you should see a New-DataGrid, New-DataGridTextColumn, and New-DataGridHyperlink cmdlet.

The dialogs are something I'd rather see in a function of their own that we ship, i.e. "Select-Folder"

Could you try using the New-DataGrid cmdlet and see if that works?

If it doesn't, can you try storing the results of ConvertFrom-TypeToScriptCmdlet into a script block and dotting them.

Hope this helps,


Jun 7, 2011 at 10:06 AM

Good to know that there is a solution for the DataGrid thing.

Jun 7, 2011 at 9:17 PM

Just tried Jakuls menu sample Show-Sample http://poshcode.org/2669 and have no idea how to run it in the released version. There seems to be a lot of changes.

Aug 28, 2013 at 7:36 AM
Just in case anyone else stumbles on that, I updated it http://poshcode.org/4421 to work in the released ShowUI 1.4

Also, for the record: we replaced Add-UIFunction with ConvertFrom-TypeToCmdlet and Add-UIModule (which generates all the types within an assembly at once). For them to work, you need to dot-source the WPFCodeGenerationRules (in ShowUI1.4 they're only loaded when we need to generate the initial assemblies -- I've changed that in source control for 1.5 so they'll always be loaded so that these commands will always work).