Problem with Generate Windows Form

I followed steps in Powershell Pro Tools documentation on using Generate Windows Form tool from the Command Palette. I created a file genform2.ps1 that contained the following:

function new-user {
param([string] $UserName, [switch] $Enabled, [ValidateSet(‘Marketing’,‘IT’, ‘HR’)] $Department)
write-host “$UserName $Enabled $Department”
}

and when I click on Generate Windows Form I get an error notice in lower right stating “Read EPIPE”. In the Explorer toolbar 2 new files are created genform2form.ps1 and genform2.designer.ps1 but the files are not opened in Visual Studio Code nor are they opened in Windows Form Designer external application.

Do the files contain anything? This sounds like a bug…

I noticed the same problems, my once working standalone forms gernerator that is now (after an update) not working any more.
Forms Generator in Visual Studio still works perfect and 100%. (Most features avaible in VS in comparision to standalone or VSC.)

1 Like

The files do contain data that appears to be valid and correct.

Ok. Thanks! Can you please try the latest version? There was an error with how the VS Code side of things was parsing JSON responses from PoshTools. You shouldn’t see the E_PIPE error any more but if you are, please let me know.

VS Code Powershell Pro Tools extension is version 5.4.5

I ran update-module PowerShellProTools and it upgraded to version 5.0.7. Same read epipe error. When you say please try the latest version, could you be more specific as to what EXACTLY you want me to upgrade?

Apologies for not being clear.

You should install the latest PowerShell Pro Tools for VS Code extension which is currently 5.4.6. The PowerShell Pro Tools module is bundled with the extension so there is not need to update that separately.