Exec
This page was generated
Contributions are welcome in Psake-repo.
SYNOPSIS
Helper function for executing command-line programs.
SYNTAX
Exec [-cmd] <ScriptBlock> [[-errorMessage] <String>] [[-maxRetries] <Int32>]
[[-retryTriggerErrorPattern] <String>] [[-workingDirectory] <String>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
DESCRIPTION
This is a helper function that runs a scriptblock and checks the PS variable $lastexitcode to see if an error occcured. If an error is detected then an exception is thrown. This function allows you to run command-line programs without having to explicitly check fthe $lastexitcode variable.
EXAMPLES
EXAMPLE 1
exec { svn info $repository_trunk } "Error executing SVN. Please verify SVN command-line client is installed"
This example calls the svn command-line client.
PARAMETERS
-cmd
The scriptblock to execute. This scriptblock will typically contain the command-line invocation.
Type: ScriptBlock
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False