-
-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
81 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
You can set retry rules for a ~~task~~ exec function by using the **maxRetries** parameter. For example, to have your ~~task~~ exec retry 3 times due to **any** unhandled exception: | ||
You can set retry rules for a **task** exec function by using the **maxRetries** parameter. For example, to have your **task** exec retry 3 times due to **any** unhandled exception: | ||
|
||
~~task MyTask -maxRetries 3~~ | ||
exec -maxRetries 3 | ||
```powershell | ||
exec -maxRetries 3 | ||
``` | ||
|
||
You can also optionally specify a ~~task~~ exec to be retried only when a certain error message occurs using the **retryTriggerErrorPattern** parameter in conjunction with **maxRetries**: | ||
You can also optionally specify a **task** exec to be retried only when a certain error message occurs using the **retryTriggerErrorPattern** parameter in conjunction with **maxRetries**: | ||
|
||
~~task MyTask -maxRetries 3 -retryTriggerErrorPattern "Service is not currently available."~~ | ||
|
||
exec -maxRetries 3 -retryTriggerErrorPattern "Service is not currently available." | ||
```powershell | ||
exec -maxRetries 3 -retryTriggerErrorPattern "Service is not currently available." | ||
``` | ||
|
||
### Notes | ||
1. psake will wait 1 second between retries. | ||
2. The default for the maxRetries parameter if not specified is 0, i.e. the task will not be retried. | ||
1. The default for the maxRetries parameter if not specified is 0, i.e. the task will not be retried. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,39 +1,38 @@ | ||
<p> | ||
*psake* is a PowerShell module and is contained in a file named psake.psm1. | ||
|
||
There are 2 ways to run psake: | ||
|
||
1) Import the psake.psm1 module and call the Invoke-psake function | ||
2) Call the psake.ps1 helper script | ||
2) Call the psake.ps1 helper script | ||
|
||
Following is the first option: | ||
</p> | ||
<pre> | ||
|
||
```powershell | ||
Import-Module .\psake.psml | ||
Invoke-psake .\default.ps1 | ||
</pre> | ||
<p> | ||
``` | ||
|
||
Second option: | ||
</p> | ||
<pre> | ||
|
||
```powershell | ||
# call the psake.ps1 file directly | ||
.\psake.ps1 .\default.ps1 | ||
</pre> | ||
<p> | ||
``` | ||
|
||
When you call the psake.ps1 script, it forwards the parameters on to the Invoke-psake function. | ||
|
||
The benefit of option 1 is that you can get detailed help on the Invoke-psake function: | ||
</p> | ||
<pre> | ||
|
||
```powershell | ||
Import-Module .\psake.psml | ||
Get-Help Invoke-psake -full | ||
</pre> | ||
<p> | ||
``` | ||
|
||
You may also consider making a helper script for your builds so that you can configure any psake options (-framework, etc) | ||
|
||
The following is an example helper script that configures psake to use the .NET 4.0 framework. | ||
</p> | ||
<pre> | ||
|
||
```powershell | ||
Import-Module (join-path $PSScriptRoot psake.psm1) -force | ||
Invoke-psake -framework '4.0' | ||
</pre> | ||
``` |