|
| 1 | + |
| 2 | +Update-PipeScript |
| 3 | +----------------- |
| 4 | +### Synopsis |
| 5 | +Updates PowerShell and PipeScript ScriptBlocks |
| 6 | + |
| 7 | +--- |
| 8 | +### Description |
| 9 | + |
| 10 | +Updates ScriptBlocks written in PowerShell or PipeScript. Also updates blocks of text. |
| 11 | + |
| 12 | +Update-PipeScript is used by PipeScript transpilers in order to make a number of changes to a script. |
| 13 | + |
| 14 | +It can also be used interactively to transform scripts or text in a number of ways. |
| 15 | + |
| 16 | +--- |
| 17 | +### Parameters |
| 18 | +#### **ScriptBlock** |
| 19 | + |
| 20 | +A Script Block, written in PowerShell or PipeScript. |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | +|Type |Requried|Postion|PipelineInput | |
| 25 | +|-------------------|--------|-------|------------------------------| |
| 26 | +|```[ScriptBlock]```|false |1 |true (ByValue, ByPropertyName)| |
| 27 | +--- |
| 28 | +#### **Text** |
| 29 | + |
| 30 | +A block of text. |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | +|Type |Requried|Postion|PipelineInput | |
| 35 | +|--------------|--------|-------|---------------------| |
| 36 | +|```[String]```|false |2 |true (ByPropertyName)| |
| 37 | +--- |
| 38 | +#### **TextReplacement** |
| 39 | + |
| 40 | +Replaces sections within text. -TextReplacement is a dictionary of replacements. |
| 41 | +Keys in the dictionary must be a string describing a character range, in the form start,end. |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | +|Type |Requried|Postion|PipelineInput| |
| 46 | +|-------------------|--------|-------|-------------| |
| 47 | +|```[IDictionary]```|false |3 |false | |
| 48 | +--- |
| 49 | +#### **AstReplacement** |
| 50 | + |
| 51 | +If set, will replace items based off of the abstract syntax tree. |
| 52 | + |
| 53 | + |
| 54 | + |
| 55 | +|Type |Requried|Postion|PipelineInput| |
| 56 | +|-------------------|--------|-------|-------------| |
| 57 | +|```[IDictionary]```|false |4 |false | |
| 58 | +--- |
| 59 | +#### **RemoveParameter** |
| 60 | + |
| 61 | +If provided, will remove one or more parameters from a ScriptBlock. |
| 62 | + |
| 63 | + |
| 64 | + |
| 65 | +|Type |Requried|Postion|PipelineInput| |
| 66 | +|----------------|--------|-------|-------------| |
| 67 | +|```[String[]]```|false |5 |false | |
| 68 | +--- |
| 69 | +#### **RenameVariable** |
| 70 | + |
| 71 | +A collection of variables to rename. |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +|Type |Requried|Postion|PipelineInput| |
| 76 | +|-------------------|--------|-------|-------------| |
| 77 | +|```[IDictionary]```|false |6 |false | |
| 78 | +--- |
| 79 | +#### **Transpile** |
| 80 | + |
| 81 | +If set, will transpile the updated script block. |
| 82 | + |
| 83 | + |
| 84 | + |
| 85 | +|Type |Requried|Postion|PipelineInput| |
| 86 | +|--------------|--------|-------|-------------| |
| 87 | +|```[Switch]```|false |named |false | |
| 88 | +--- |
| 89 | +### Syntax |
| 90 | +```PowerShell |
| 91 | +Update-PipeScript [[-ScriptBlock] <ScriptBlock>] [[-Text] <String>] [[-TextReplacement] <IDictionary>] [[-AstReplacement] <IDictionary>] [[-RemoveParameter] <String[]>] [[-RenameVariable] <IDictionary>] [-Transpile] [<CommonParameters>] |
| 92 | +``` |
| 93 | +--- |
| 94 | + |
| 95 | + |
0 commit comments