4

This might sound silly but I have been trying to execute a NUnit test using powershell script, had several attempts but no hope. is there different format or do I need to add a plugin?

Any help would be appriciated...

Command = "c:\Program Files\NUnit 2.4.8\bin\nunit-console.exe" /config=Release "C:\projects\IntegrationTests\IntegrationTests.nunit" 2>&1

Output as below:

PS C:\tests> "c:\Program Files\NUnit2.4.8\bin\nunit-console.exe" /config=Release

"C:\projects\IntegrationTests\IntegrationTests.nunit" 2>&1

You must provide a value expression on the right-hand side of the '/' operator.

At line:1 char:55 + "c:\Program Files\NUnit 2.4.8\bin\nunit-console.exe" / <<<<

config=Release "C:\projects\IntegrationTests\IntegrationTests.nunit" 2>&1

Thanks in Advance

Ozie Harb
  • 357
  • 2
  • 3
  • 14

2 Answers2

2

You didn't put the part

/config=Release

inside your quoted command text.

Your command should probably look like

"c:\Program Files\NUnit 2.4.8\bin\nunit-console.exe /config=Release C:\projects\IntegrationTests\IntegrationTests.nunit" 2>&1

... i didn't check nunit-console.exe command line options, but i suppose you already tested if the nunit command works.

Filburt
  • 17,626
  • 12
  • 64
  • 115
  • 2
    Powershell point of view : you must put a '&' in the start of your line so it is not considered as a string but like a command to execute. | NUnit point of view : options like /config=Release must be come last – Cédric Rup Jan 22 '10 at 10:12
  • @Cédric Thanks for support on the nunit side ... considering the question i should rather have pointed out that assigning the command string to a variable needs $Command = "..." – Filburt Jan 22 '10 at 10:48
  • Thanks for your help, that did help me out... using "" did not work but replacing them with '' does the trick :-) Working command & 'c:\Program Files\NUnit 2.4.\bin\nunitconsole.exe' /config=Release C:\Projects\IntegrationTests\IntegrationTests.nunit 2>&1 Much appreciated. – Ozie Harb Jan 22 '10 at 11:12
2

Sorry for the mess in the top dialog, proper code version below

& 'c:\Program Files\NUnit 2.4.\bin\nunitconsole.exe' /config=Release C:\Projects\IntegrationTests\IntegrationTests.nunit 2>&1
Ozie Harb
  • 357
  • 2
  • 3
  • 14