Comments (7)
@Arithmomaniac thanks for the issue, I agree it should be fixed. I've marked it as Approved.
I think I know how to fix it. When calling msbuild.exe
we should use a pattern like what I'm using at https://github.com/sayedihashimi/publish-module/blob/master/package-downloader.psm1#L46. Here is the function
function Execute-CommandString{
[cmdletbinding()]
param(
[Parameter(Mandatory=$true,Position=0,ValueFromPipeline=$true)]
[string[]]$command,
[switch]
$ignoreExitCode
)
process{
foreach($cmdToExec in $command){
'Executing command [{0}]' -f $cmdToExec | Write-Verbose
cmd.exe /D /C $cmdToExec
if(-not $ignoreExitCode -and ($LASTEXITCODE -ne 0)){
$msg = ('The command [{0}] exited with code [{1}]' -f $cmdToExec, $LASTEXITCODE)
throw $msg
}
}
}
}
from psbuild.
OK turns out the fix was simpler than I thought. I've updated the module in the dev
branch. Can you try it and re open if you still have issues?
from psbuild.
What if there's an apostrophe inside the string argument? With this method, you should have logic to escape that too.
from psbuild.
Thanks now that I'm thinking more here's your idea 💡 with some others.
- Add quotes if not already quoted
- Add a global setting which is true by default to enable
- Add a parameter to Invoke-MSBuild
from psbuild.
Hi @Arithmomaniac I have made the changes outlined in the commit aacb74f. Could you review and let me know if this looks better? Will close for now.
from psbuild.
Looks like this broke some existing builds, see #54.
I've disabled it globally and released. You can enable with the global option EnablePropertyQuoting.
from psbuild.
Should be fixed after the updates
from psbuild.
Related Issues (20)
- Add a module manifest
- Add Import-FileReplacer
- Provide custom directory for log files HOT 4
- Build same project in multiple locations log files are overridden
- GetPSBuild.ps1 fails if run under LocalSystem account HOT 11
- Invoke-MSBuild not splatting $ignoreExitCode switch HOT 2
- Verify projects for required properties HOT 8
- Don't add quotes to command unless needed
- Nuget.exe download fails in GetPSBuild.ps1 HOT 4
- Masking secrets (even if not used) interferes with the prompt
- Change default of masking secrets to false unless running on CI
- Support for PowerShell Core HOT 10
- Make everything self-contained HOT 1
- Use System.Security.Cryptography.Algorithms NuGet pkg for hash algo
- Add 15.0 to VisualStudioVersion HOT 1
- Is it possible to install it offline the package? if so , can you please instruct. HOT 7
- Does not use msbuild 15 automatically HOT 2
- Installation of psbuild failed "Could not find part of the path" HOT 2
- Add PSBuild to the PowerShell Gallery
- Upload to nuget fails due to old CLI tool HOT 1
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 psbuild.