0

I have tried to find the solution of my problem but in vain. im new to VS2010 package manager console.

We have started up a project using Pickles to generate a document tree of all our accpetance tests. To update the acceptance test, i need to enter pm>Pickle-Features -FeatureDirectory .\Features -OutputDirectory .\Html manually. what im after is to add this to my WPF c# solution so everytimee i compile my project, i will also update the document tree.

I have create a test project and added what is suggested in the following post Execute a NuGet command from c# code still, i cant get it to work. keep on getting the following message System.Management.Automation.CommandNotFoundException however when i run the command in the VS2010 package manager console, the command is working like a charm.

private void RunPowershell()
{
    const string command = "Pickle-Features -FeatureDirectory .\\Features -OutputDirectory .\\Html";
    try 
    {
        var powerShell = PowerShell.Create();
        powerShell.AddCommand(command);
        powerShell.Invoke();
    }
    catch (Exception e)
    {
        lbl.Content = e.ToString();
    }
}
Community
  • 1
  • 1
matt
  • 1
  • 1

1 Answers1

0

I think you should make that command a post-build event command line on your WPF project.

Andrei Gavrila
  • 853
  • 9
  • 19
  • First, you must copy .ps1 to root of project and so put `Powershell -File "$(ProjectDir)File.ps1"` on post-build event command line. – Mohsen Alikhani Nov 20 '12 at 10:23