Questions tagged [psake]

psake (pronounced *sah-kay*, as in Japanese rice wine) is a build automation tool implemented in Windows PowerShell.

Description

psake (pronounced sah-kay, as in Japanese rice wine) is a build automation tool implemented in Windows PowerShell. psake has a syntax inspired by rake (aka make in Ruby) and bake (aka make in Boo).

Example Build Script

properties { 
  $testMessage = ‘Executed Test!’ 
  $compileMessage = ‘Executed Compile!’ 
  $cleanMessage = ‘Executed Clean!’ 
}

task default -depends Test

task Test -depends Compile, Clean { 
  Write-Host $testMessage 
}

task Compile -depends Clean { 
  Write-Host $compileMessage 
}

task Clean { 
  Write-Host $cleanMessage 
}

Resources

105 questions
1
vote
1 answer

psake set execution directory

I’m trying to move form MSBuild to psake. My repository structure looks like this: .build | buildscript.ps1 .tools packages MyProject MyProject.Testing MyProject.sln I want to clean the repository before building (using git clean -xdf). But I…
musium
  • 2,942
  • 3
  • 34
  • 67
1
vote
2 answers

Create new absolute path from absolute path + relative or absolute path

I am working on a build script using psake and I need to create an absolute path from the current working directory with an inputted path which could either be a relative or absolute path. Suppose the current location is…
Matthew
  • 24,703
  • 9
  • 76
  • 110
1
vote
1 answer

psake calling npm install with msys_version

I need to ensure some NPM dependencies are installed, and some of those use node_gyp to compile. That means I have to call "npm install --msvs_version=2013" so node_gyp will use my vs.net 2013 compiler. But for some reason, adding this to a psake…
Jake Stevenson
  • 3,009
  • 6
  • 35
  • 40
1
vote
1 answer

Is the order of dependencies deterministic in psake?

task A -depends B, C, D { ... } task B { ... } task C { ... } task D { ... } Is build script guaranteed to run in this order? (B - C - D) - A Or backwards? (D - C - B) - A Or random? (B - D - C) - A Or in parallel? B \ \ C--A / / D
Carlos Muñoz
  • 17,397
  • 7
  • 55
  • 80
1
vote
1 answer

psake error code management

I have a task running a mercurial command that fails because mercurial is not returning 0 but 1. When mercurial returns 1 does not mean it's an error but there is nothing to do. According to the documentation: Returns 0 if push was successful, 1 if…
JuChom
  • 5,717
  • 5
  • 45
  • 78
1
vote
0 answers

Exit Code -1 when executing psake task

I have a psake task that I run from my build script to verify that the expected artifacts are created in the expected location. It seems to work when I run it from the command line, however it is returning an error code of "-1" when the assert…
matt
  • 103
  • 1
  • 7
1
vote
1 answer

msbuild package target issue

I have an MVC 4 web app with VS2012, msbuild and am creating a build script with psake. I've created a publish profile in VS that packages up the project into a zip file. Running it from within VS works fine. However, running it from the command…
ashic
  • 6,367
  • 5
  • 33
  • 54
1
vote
1 answer

Error when executing Invoke-psake without parameters

I just installed psake version 4.2.0. I put this in default.ps1 properties { $message = "Task A executed" } task default -depends taskA task taskA { write-host $taskAmessage } If I run Invoke-psake taskA, then the task is executed as…
Animesh
  • 4,926
  • 14
  • 68
  • 110
1
vote
1 answer

How to set permissions/acl on a file in remote website using msdeploy & powershell/psake

Have a build script in psake/powershell that compiles and deploys a website to remote server using msdeploy. I need to set the acl's on one file in the root after the deployment. Anyone done this? I know I can use msdeploy but can't get the syntax…
Samuel Goldenbaum
  • 18,391
  • 17
  • 66
  • 104
1
vote
1 answer

Spaced paths, msbuild, and psake

Related question here. This works properly for compiling an mvc3 application. task Compile { $config = $script:siteConfig.config exec { & "C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe" $webproject_path ` …
Daniel Harvey
  • 381
  • 5
  • 16
0
votes
1 answer

Check that projects have Warnings As Errors

I have been automating all my builds through PSake and finding it really useful to get my TeamCity build more powerful. One thing I would like to introduce is a step to make sure all projects in a solution have warnings as errors set to true. It…
ArtificialGold
  • 825
  • 5
  • 14
0
votes
0 answers

Fail to build using Invoke-PSake through Visual Studio Code

When I try to build using (F5) I am getting an error when the build is invoked using Invoke-PSake. I am able to build the file using the shortcut (CTRL+SHIFT+B) or by using the command "Invoke-Psake -BuildFile FilePath" in the vscode command line.…
0
votes
1 answer

Prevent warning from application execution from outputting an error to VSO

I have a pwsh task that executes apt install as part of a psake exec. The apt install appears to throw a warning that makes it into the pipeline output stream no matter how I try to trap it: "WARNING: apt does not have a stable CLI interface. Use…
0
votes
1 answer

Simple Psake build fails with "shared task" exception

I have the following simple psakefile.ps1: Task Build { Write-Host "Build" } When I invoke it using my build.ps1: nuget install psake -version 4.9.0 Import-Module .\psake.4.9.0\tools\psake\psake.psm1 -Force Invoke-psake psakefile.ps1 I get an…
Neil Barnwell
  • 41,080
  • 29
  • 148
  • 220
0
votes
0 answers

Template parameters for powershell script in Visual Studio project template?

I have a project template that contains a powershell script called BuildStandard.ps1. Inside that script is the following excerpt: Invoke-psake -buildFile $psakeScript ` -parameters @{ "solutionFile" =…
ket
  • 728
  • 7
  • 22