Comments (4)
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.
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.
If there are no more questions or related issues please close the issue.
from invoke-build.
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)
- Improve `exec -echo` ANSI rendering
- Write-Build: render lines separately if ANSI.
- Amend output on task errors.
- Reusing or sharing tasks HOT 5
- ib.cmd ? ignores a specified file
- vscode outline view: no symbols found in document HOT 2
- Different module and package versions HOT 2
- Parallel execution based on dependency tree HOT 2
- invoke-build discovery fails in powershell container HOT 3
- Please consider adding -Computername and -Session parameter to Task HOT 8
- GitHub action output is not colored
- Color and formatting text in Azure DevOps Pipelines HOT 8
- Use-BuildEnv should make parameters mandatory
- Invoke-BuildExec spitting out service principal secret as current directory HOT 6
- Exec doesn't work well with forward slash arguments HOT 7
- Use `[System.Management.Automation.Cmdlet]::CommonParameters` to get the names of all common parameters HOT 3
- Task condition does not work HOT 8
- Build-Parallel writes only to Output stream HOT 7
- property 'File' cannot be found on this object HOT 17
- Do not wrap internal errors in Resolve-MSBuild
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from invoke-build.