GithubHelp home page GithubHelp logo

Comments (4)

nightroman avatar nightroman commented on May 27, 2024

Take a look at the Invoke-Build syntax (help Invoke-Build):

Invoke-Build.ps1 [[-Task] <String[]>] [[-File] <String>] ...

Note that Task is the first positional parameter and File is the second.

.\packages\Invoke-Build\tools\Invoke-Build .\.build\Build.ps1

The above command specifies the task .\.build\Build.ps1 (unusual but possible name) and no build script. As a result, Invoke-Build looks for the default script in the current location and then in its parent directories. It is not found, hence the error.

You should either specify the parameter name -File:

.\packages\Invoke-Build\tools\Invoke-Build -File .\.build\Build.ps1

or specify the default task explicitly as the first positional parameter, as the syntax requires:

.\packages\Invoke-Build\tools\Invoke-Build . .\.build\Build.ps1

from invoke-build.

nightroman avatar nightroman commented on May 27, 2024

By the way, your script Build.ps1 will not be recognized as the default even if it is in the current directory. By the convention it should be either named .build.ps1 or something.build.ps1. In the latter case it also should be the only like *.build.ps1 in its directory in order to be recognized as the default for this directory.

If you are planning to use it as the default script in some commands then it should be renamed. It is also convenient to put it to the root directory of a project. In this case Invoke-Build will find it as the default script when it is invoked in any child directory of the project (assuming there are no other build scripts there).

And if you put the default build script (named properly) to the root of your project then you can call its default task simply as

.\packages\Invoke-Build\tools\Invoke-Build

from invoke-build.

nightroman avatar nightroman commented on May 27, 2024

If there are no more questions or related issues please close the issue.

from invoke-build.

DaveSenn avatar DaveSenn commented on May 27, 2024

Sorry had no time to check you answer until now.
Thank you very much for your answer.
Specifying the name of the parameter works perfectly.

from invoke-build.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.