Skip to content

Refactor: Tasksetup#316

Merged
HeyItsGilbert merged 1 commit intopsake:masterfrom
Splaxi:refactor-tasksetup-pascal
Sep 21, 2024
Merged

Refactor: Tasksetup#316
HeyItsGilbert merged 1 commit intopsake:masterfrom
Splaxi:refactor-tasksetup-pascal

Conversation

@Splaxi
Copy link
Copy Markdown
Contributor

@Splaxi Splaxi commented Apr 14, 2022

Convert parameter names into pascal

Description

Convert parameter names into pascal

Related Issue

#308

Motivation and Context

How Has This Been Tested?

ps>Get-Help TaskSetup -Full

NAME
    TaskSetup

SYNOPSIS
    Adds a scriptblock that will be executed before each task


SYNTAX
    TaskSetup [-Setup] <ScriptBlock> [<CommonParameters>]


DESCRIPTION
    This function will accept a scriptblock that will be executed before each task in
    the build script.

    The scriptblock accepts an optional parameter which describes the Task being setup.


PARAMETERS
    -Setup <ScriptBlock>
        A scriptblock to execute

        Required?                    true
        Position?                    1
        Default value
        Accept pipeline input?       false
        Accept wildcard characters?  false

    <CommonParameters>
        This cmdlet supports the common parameters: Verbose, Debug,
        ErrorAction, ErrorVariable, WarningAction, WarningVariable,
        OutBuffer, PipelineVariable, and OutVariable. For more information, see
        about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

    -------------------------- EXAMPLE 1 --------------------------

    PS C:\>A sample build script is shown below:

    Task default -Depends Test

    Task Test -Depends Compile, Clean {
    }

    Task Compile -Depends Clean {
    }

    Task Clean {
    }

    TaskSetup {
        "Running 'TaskSetup' for task $context.Peek().currentTaskName"
    }

    The script above produces the following output:

    Running 'TaskSetup' for task Clean
    Executing task, Clean...
    Running 'TaskSetup' for task Compile
    Executing task, Compile...
    Running 'TaskSetup' for task Test
    Executing task, Test...

    Build Succeeded




    -------------------------- EXAMPLE 2 --------------------------

    PS C:\>A sample build script showing access to the Task context is shown below:

    Task default -Depends Test

    Task Test -Depends Compile, Clean {
    }

    Task Compile -Depends Clean {
    }

    Task Clean {
    }

    TaskSetup {
        param($task)

        "Running 'TaskSetup' for task $($task.Name)"
    }

    The script above produces the following output:

    Running 'TaskSetup' for task Clean
    Executing task, Clean...
    Running 'TaskSetup' for task Compile
    Executing task, Compile...
    Running 'TaskSetup' for task Test
    Executing task, Test...

    Build Succeeded





RELATED LINKS
    Assert
    Exec
    FormatTaskName
    Framework
    Get-PSakeScriptTasks
    Include
    Invoke-psake
    Properties
    Task
    TaskTearDown

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@HeyItsGilbert HeyItsGilbert merged commit 812bf19 into psake:master Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants