Skip to content

Commit 0001b44

Browse files
Merge pull request #229 from StartAutomating/PipeScriptUpdates
Pipe script updates
2 parents 2653057 + b50c74f commit 0001b44

16 files changed

+648
-19
lines changed

CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
## 0.1.4:
2+
* ValidateScriptBlock improvements
3+
* Adding -NoLoop/-NoWhileLoop (Fixes #227)
4+
* Adding -IncludeCommand/-ExcludeCommand (Fixes #224)
5+
* Adding -IncludeType/-ExcludeType (Fixes #225)
6+
* Adding -AstCondition (Fixes #226)
7+
* Improved documentation of [decorate] transpiler (Fixes #222)
8+
* Core Parameter Transpiler no longer considers real types (Fixes #223)
9+
* Adding new value for PipeScript.PipeScriptType: BuildScript (Fixes #228)
10+
---
11+
112
## 0.1.3:
213
* New Protocols: UDP (Fixes #208)
314
* New Inline Language Support:

Get-PipeScript.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Piecemeal [ 0.3.4 ] : Easy Extensible Plugins for PowerShell
1+
#region Piecemeal [ 0.3.5 ] : Easy Extensible Plugins for PowerShell
22
# Install-Module Piecemeal -Scope CurrentUser
33
# Import-Module Piecemeal -Force
44
# Install-Piecemeal -ExtensionNoun 'PipeScript' -ExtensionPattern '\.psx\.ps1{0,1}$','\.ps1{0,1}\.(?<ext>[^.]+$)','\.ps1{0,1}$' -ExtensionTypeName 'PipeScript' -OutputPath '.\Get-PipeScript.ps1'
@@ -925,5 +925,5 @@ function Get-PipeScript
925925
}
926926
}
927927
}
928-
#endregion Piecemeal [ 0.3.4 ] : Easy Extensible Plugins for PowerShell
928+
#endregion Piecemeal [ 0.3.5 ] : Easy Extensible Plugins for PowerShell
929929

Get-Transpiler.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#region Piecemeal [ 0.3.4 ] : Easy Extensible Plugins for PowerShell
1+
#region Piecemeal [ 0.3.5 ] : Easy Extensible Plugins for PowerShell
22
# Install-Module Piecemeal -Scope CurrentUser
33
# Import-Module Piecemeal -Force
44
# Install-Piecemeal -ExtensionNoun 'Transpiler' -ExtensionPattern '\.psx\.ps1$' -ExtensionTypeName 'PipeScript.Transpiler' -OutputPath '.\Get-Transpiler.ps1'
@@ -925,5 +925,5 @@ function Get-Transpiler
925925
}
926926
}
927927
}
928-
#endregion Piecemeal [ 0.3.4 ] : Easy Extensible Plugins for PowerShell
928+
#endregion Piecemeal [ 0.3.5 ] : Easy Extensible Plugins for PowerShell
929929

ListOfTranspilers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ These are all of the transpilers currently included in PipeScript:
1010
|[Bash](Transpilers/Wrappers/Bash.psx.ps1) |Wraps PowerShell in a Bash Script |
1111
|[Batch](Transpilers/Wrappers/Batch.psx.ps1) |Wraps PowerShell in a Windows Batch Script |
1212
|[BatchPowerShell](Transpilers/Wrappers/BatchPowerShell.psx.ps1) |Wraps PowerShell in a Windows Batch Script |
13-
|[Decorate](Transpilers/Decorate.psx.ps1) |
13+
|[Decorate](Transpilers/Decorate.psx.ps1) |decorate transpiler |
1414
|[Dot](Transpilers/Syntax/Dot.psx.ps1) |Dot Notation |
1515
|[EqualityComparison](Transpilers/Syntax/EqualityComparison.psx.ps1) |Allows equality comparison. |
1616
|[EqualityTypeComparison](Transpilers/Syntax/EqualityTypeComparison.psx.ps1) |Allows equality type comparison. |

PipeScript.format.ps1xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-16"?>
2-
<!-- Generated with EZOut 1.9.2: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
2+
<!-- Generated with EZOut 1.9.3: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
33
<Configuration>
44
<Controls>
55
<Control>

PipeScript.psd1

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@{
2-
ModuleVersion = '0.1.3'
2+
ModuleVersion = '0.1.4'
33
Description = 'An Extensible Transpiler for PowerShell (and anything else)'
44
RootModule = 'PipeScript.psm1'
55
PowerShellVersion = '4.0'
@@ -19,6 +19,17 @@
1919
BuildModule = @('EZOut','Piecemeal','PipeScript','HelpOut', 'PSDevOps')
2020
Tags = 'PipeScript','PowerShell', 'Transpilation', 'Compiler'
2121
ReleaseNotes = @'
22+
## 0.1.4:
23+
* ValidateScriptBlock improvements
24+
* Adding -NoLoop/-NoWhileLoop (Fixes #227)
25+
* Adding -IncludeCommand/-ExcludeCommand (Fixes #224)
26+
* Adding -IncludeType/-ExcludeType (Fixes #225)
27+
* Adding -AstCondition (Fixes #226)
28+
* Improved documentation of [decorate] transpiler (Fixes #222)
29+
* Core Parameter Transpiler no longer considers real types (Fixes #223)
30+
* Adding new value for PipeScript.PipeScriptType: BuildScript (Fixes #228)
31+
---
32+
2233
## 0.1.3:
2334
* New Protocols: UDP (Fixes #208)
2435
* New Inline Language Support:

PipeScript.types.ps1xml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-16"?>
2-
<!-- Generated with EZOut 1.9.2: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
2+
<!-- Generated with EZOut 1.9.3: Install-Module EZOut or https://github.com/StartAutomating/EZOut -->
33
<Types>
44
<Type>
55
<Name>System.Management.Automation.Language.Ast</Name>
@@ -428,6 +428,9 @@ $this.Parent.GetType().Name -in 'AssignmentStatementAST', 'HashtableAST'
428428
elseif ($this.Source -match "\.ps1{0,1}\.(?&lt;ext&gt;[^.]+$)") {
429429
"SourceGenerator"
430430
}
431+
elseif (($this.Source -match '\.[^\.\\/]+\.ps1$') -or ($this.Source -match 'build\.ps1$')) {
432+
"BuildScript"
433+
}
431434
elseif ($this.Source) {
432435
"PipeScriptFile"
433436
}

Transpilers/Core/PipeScript.ParameterAttribute.psx.ps1

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@
22
33
#>
44
[ValidateScript({
5-
$_.Parent -is [Management.Automation.Language.ParameterAst]
5+
if (-not $_.Parent -is [Management.Automation.Language.ParameterAst]) {
6+
return $false
7+
}
8+
9+
$isRealType = $_.TypeName.GetReflectionType()
10+
if ($isRealType) { return $false }
11+
return $true
612
})]
713
param(
814
[Parameter(Mandatory,ParameterSetName='ParameterAst',ValueFromPipeline)]

Transpilers/Decorate.psx.ps1

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
[Alias('PSTypeName', 'Management.Automation.PSTypeName', 'System.Management.Automation.PSTypeName')]
2-
[CmdletBinding(DefaultParameterSetName='ScriptBlock')]
1+
<#
2+
.SYNOPSIS
3+
decorate transpiler
4+
.DESCRIPTION
5+
Applies one or more typenames to an object.
6+
By 'decorating' the object with a typename, this enables use of the extended type system.
7+
.EXAMPLE
8+
{
9+
$v = [PSCustomObject]@{}
10+
[decorate('MyTypeName',Clear,PassThru)]$v
11+
}.Transpile()
12+
#>
13+
[Alias('PSTypeName', 'Management.Automation.PSTypeName', 'System.Management.Automation.PSTypeName')]
314
param(
415
# The variable decoration will be applied to.
5-
[Parameter(Mandatory=$true,ParameterSetName='VariableAST', ValueFromPipeline)]
16+
[Parameter(Mandatory,ParameterSetName='VariableAST', ValueFromPipeline)]
617
[Management.Automation.Language.VariableExpressionast]
718
$VariableAst,
819

@@ -31,7 +42,7 @@ process {
3142
if ($clear) {
3243
$variableText + ".pstypenames.clear()"
3344
}
34-
foreach ($tn in $PSTypeName) {
45+
foreach ($tn in $TypeName) {
3546
$stn = $tn.Replace("'","''")
3647
$variableText + ".pstypenames.add('$stn')"
3748
}

0 commit comments

Comments
 (0)