Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6620655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:07:47+00:00 2026-05-25T21:07:47+00:00

Trying to get a PSAKE script to work. Its seems that tasks are not

  • 0

Trying to get a PSAKE script to work. Its seems that tasks are not executing the functions within them?

I have 2 files

-- default.ps1 --
Import-Module "C:\dev\Phoenix\trunk\Build\BuildScripts\include.ps1"
Import-Module "C:\Software\PSAKE\JamesKovacs-psake-b0094de\psake.psm1"
Invoke-psake "C:\dev\Phoenix\trunk\Build\BuildScripts\build.ps1"
remove-module psake


-- build.ps1 --
$framework = '4.0'

properties {
    $root_dir = 'c:\dev\Phoenix\trunk\'
    $integration_deploy_dir = '\\Server025\Phoenix_IntegrationTests\'
    $build_scripts_dir = '$root_dir\Build\BuildScripts'
    $test_dir =  Join-Path $root_dir '\Tests\Core.UnitTests\bin\Debug'
    $dll = Join-Path $test_dir 'Phoenix.Core.UnitTests.dll'
} 


task default -depends Test

task MsBuild {  exec { msbuild /version }}

task Test -depends Deploy
{
    Write-Host "Start task Test"
Add-PSSnapIn Gallio
Write-Host "TEST --  $dll" 
Test-Gallio $test_dir Release x64 $dll "Core.UnitTests"     ## FYI - call to include func
Write-Host "End task Test"
}

task Deploy
{
Write-Host "Start task deploy"
Write-Host "Deploying to integration server"
copy $root_dir"\Sites" $integration_deploy_dir -Recurse -Force
Write-Host "End task deploy"    
}

At the moment it just seems to ‘print out’ the stuff listed within tasks without actually doing anything. What am I missing? Thanks

Sorry forgot to mention I really just want to get the COPY method working first — thx


Thanks for the help – Ive made all your suggestions and still no luck.

If I put the code ‘inline’ rather that in PSAKE tasks the code runs fine.

I now have this

-- default.ps1
Import-Module C:\dev\Phoenix\trunk\Build\BuildScripts\include.ps1
Import-Module C:\Software\PSAKE\JamesKovacs-psake-b0094de\psake.psm1
Invoke-psake C:\dev\Phoenix\trunk\Build\BuildScripts\build.ps1
remove-module psake

— build.ps1
$framework = ‘4.0’

properties {
$root_dir = 'c:\dev\Phoenix\trunk'
$sites_dir = 'c:\dev\Phoenix\trunk\sites'
$integration_deploy_dir = '\\Vsydnweb025\Phoenix_IntegrationTests\'
$build_scripts_dir = "$root_dir\Build\BuildScripts"
}

task default -depends Deploy

task Deploy
{
Write-Host 'Start task deploy'
Write-Host 'Deploying to integration server'
copy $sites_dir $integration_deploy_dir -Recurse -Force
Write-Host 'End task deploy'
get-childitem $integration_deploy_dir -include *.svclog -recurse | foreach ($_)  {remove-item $_.fullname}
}

The output of this is as follows:

Write-Host 'Start task deploy'
Write-Host 'Deploying to integration server'
copy $sites_dir $integration_deploy_dir -Recurse -Force
Write-Host 'End task deploy'
get-childitem $integration_deploy_dir -include *.svclog -recurse | foreach ($_) {remove-item $_.fullname}


Build Succeeded!

----------------------------------------------------------------------
Build Time Report
----------------------------------------------------------------------
Name   Duration        
----   --------        
Deploy 00:00:00.0006013
Total: 00:00:02.5335350

So it seems the functions within the task are just being printed out.

The copy function did not run – nor the Piped .SvcLog file delete

Ie on the screen I would expect

‘Start task deploy’

instead of

Write-Host ‘Start task deploy’

Ill keep trying to get it to work.

Thanks for your help!!!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:07:47+00:00Added an answer on May 25, 2026 at 9:07 pm

    Had this answered in the google group

    The beginning “{” needs to be on the same line as the “task” function since
    it’s a scriptblock that is being passed as a parameter to the “task”
    function. PS is interpreting your code as 2 statements instead of 1
    statement.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Trying to get comfortable with jQuery and I have encountered some sample code that
Trying to get all articles, with unique titles (distinct(title)), that have a body of
I'm trying get LocalConnection to work between two swf's placed within two different IFRAMES.
I am trying get a div that I have hidden to show in the
Trying to get my css / C# functions to look like this: body {
Trying to get this to work, with no luck: [DataMember] public Type ParameterType {
Trying to get a JSON output to work with jqGrid 'userdata' option. The example
I am trying get content from the link https://....com:8455 where Server's certificate is not
I am trying get the html within .event_recur. $(.entry).each(function(){ alert($(this).find(.event_recur).html()); }); <div class=entry> <p
I've been at this for 12+ exhausting hours trying get it to work on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.