Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9024913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T06:08:36+00:00 2026-06-16T06:08:36+00:00

I can’t seem to call this executable correctly in my psake deploy script. If

  • 0

I can’t seem to call this executable correctly in my psake deploy script.

If I do this:

exec { "$ArchiverOutputDir\NServiceBus.Host.exe /install" }

It simply outputs this (and is clearly not calling the executable – just outputting the value of that expression):

c:\ReloDotNet2_ServiceEndpoints\Archiver\NServiceBus.Host.exe /install

But if I do this:

exec { c:\ReloDotNet2_ServiceEndpoints\Archiver\NServiceBus.Host.exe /install }

I get the expected output from the executable.

How do I correctly call an executable with a variable in the path to the executable in psake? If this is actually a PowerShell issue, please feel free to correct the question to reflect that insight.

I

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T06:08:37+00:00Added an answer on June 16, 2026 at 6:08 am

    Classic PowerShell issue. Try this instead:

    exec { & "$ArchiverOutputDir\NServiceBus.Host.exe" /install }
    

    PowerShell not only executes commands, it also evaluates expressions e.g.:

    C:\PS> 2 + 2
    4
    C:\PS> "hello world"
    hello world
    

    What you have given to PowerShell at the beginning of a pipeline is a string expression which it faithfully evaluates and prints to the console. By using the call operator &, you’re telling PowerShell that the following thing is either the name of a command (in a string) to be executed or a scriptblock to be executed. Technically you could also use . "some-command-name-or-path". The only difference is that for PowerShell commands, & creates a new scope to execute the command in and . doesn’t. For external exes it makes no difference as far as I can tell which one you use but & is typically used.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone explain to me why this program: for(float i = -1; i <
Can I call select before recv_from on a socket that is blocking?
Can someone maybe tell me why this is not working? I have used echo
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Can somebody help me construct this regular expression, please... Given the following strings... "April
Can anyone tell me why this doesn't work? <?php $lang = $_get[lang]; if (($lang
Can any one help me in sorting this out in sed/awk/perl Input file Start
Can i call a Method on the Thread Object ??
Does anyone know how can I replace this 2 symbol below from the string
Can find why i get this error can someone help? package Android.data; public class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.