Comments (6)
Why $pwd
? Well, why not? Using Get-Location
may have some advantages (and disadvantages). Just like using $pwd
, some advantages and disadvantages.
from invoke-build.
exec -echo {...}
prints $pwd
as cd $pwd
, see
Line 269 in ccb3839
Is it possible that your $pwd
contains such a value? If yes then it all works as expected.
If such "echo" is not welcome then do not use this switch with exec
.
from invoke-build.
Hmm, an idea. Do you by any chance use the PowerShell automatic variable $pwd
(current location) as a some sort of password?
from invoke-build.
If yes, I'd say it is not a good idea to mess with PS automatic variables, who knows when and how this bites.
But this is up to the author / script, indeed, no problem.
In the meantime I'll think of printing cd $global:pwd
to minimize chances of such issues.
from invoke-build.
Yes, you're right. There was another function within the same module assigning $script:pwd
which within a module means module-wide scope.
The $global:pwd
sounds good 👍
Question: Why not
Get-Location
? Because it's isn't available in PowerShell 2.0?
Benefit from Get-Location
would be that it's supported by Pester Mock. Not that I can think off the shelf a scenario where one would want to use it...
Describe "Get-Location" {
Context "Mocking works..." {
BeforeEach{
Mock Get-location { return @{ Path = 'D:\' } }
$script:result = Get-Location
}
It "should work" {
$script:result.Path | Should -Be 'D:\'
}
}
}
from invoke-build.
Done, v5.10.2
from invoke-build.
Related Issues (20)
- 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
- 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
- Fix cryptic errors on unknown parameters
- Invoke-BuildExec should pass the original stderr error to the thrown terminating error HOT 38
- dotnet tool ib run script by default as powershell. Possible to configure? HOT 9
- echo output of exec {} block prints out entire parent object of a parameter when property of an object passed as parameter HOT 3
- Dot-sourcing common build script for multiple subprojects and parameters HOT 6
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.