Skip to content

Commit

Permalink
Convert-psake.ps1 - removed old psake task parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
nightroman committed May 22, 2016
1 parent 967b06c commit 1f8b89e
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions Convert-psake.ps1
Expand Up @@ -42,12 +42,12 @@
Use an extra action with assert in Jobs: ..., {assert ...}
ContinueOnError ->
Use (job TaskName -Safe) in parent tasks.
Description ->
Use help comments: # Synopsis: ...
RequiredVariables ->
Use "$VarName = property VarName" in the action.
Alias, MaxRetries, RetryTriggerErrorPattern ->
Not supported.
Description ->
Use help comments: # Synopsis: ...
Alias ->
Use another task: task Alias TaskName
properties ->
Simply copy the code from "properties" to the script scope.
Expand Down Expand Up @@ -125,8 +125,6 @@
.Parameter Synopsis
Tells to add "# Synopsis:" even for tasks with no Description.
.Inputs
None.
.Outputs
Converted code. Save it to a file by redirecting to Set-Content. Use of ">"
or "Out-File" is not recommended due to potentially breaking line wrapping.
Expand All @@ -149,8 +147,8 @@ param(
[switch]$Synopsis
)

trap {$PSCmdlet.ThrowTerminatingError($_)}
$ErrorActionPreference = 'Stop'
try { # amend errors

### Source

Expand Down Expand Up @@ -230,9 +228,7 @@ function Write-Task
[string[]]$depends,
[string[]]$requiredVariables,
[string]$description,
[string]$alias,
[string]$maxRetries,
[string]$retryTriggerErrorPattern
[string]$alias
)

if ($description -or ${*Synopsis}) {
Expand All @@ -243,8 +239,6 @@ function Write-Task
if ($alias) {"# TODO: Alias '$alias' is not supported. Do not use it or define another task: task $alias $($name)"}
if ($continueOnError) {"# TODO: ContinueOnError is not supported. Instead, in parent tasks use references: (job $name -Safe)"}
if ($requiredVariables) {'# TODO: RequiredVariables is not supported. Instead, in the action use: $VarName = property VarName'}
if ($maxRetries) {'# TODO: MaxRetries is not supported.'}
if ($retryTriggerErrorPattern) {'# TODO: RetryTriggerErrorPattern is not supported.'}

### task Name
$$ = 'task '
Expand Down Expand Up @@ -348,7 +342,5 @@ $text
}

if ($warnings) {
Write-Warning "The script has been converted with $warnings error(s)."
Write-Warning "Converted with $warnings error(s)."
}

} catch { $PSCmdlet.ThrowTerminatingError($_) }

0 comments on commit 1f8b89e

Please sign in to comment.