Skip to content

Commit

Permalink
More transforms added
Browse files Browse the repository at this point in the history
  • Loading branch information
jformacek committed Oct 30, 2020
1 parent 55052fe commit 00c0f97
Show file tree
Hide file tree
Showing 2 changed files with 104 additions and 0 deletions.
52 changes: 52 additions & 0 deletions Transforms/Boolean.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

[CmdletBinding()]
param (
[Parameter()]
[Switch]
$FullLoad
)

if($FullLoad)
{
# Add any types that are used by transforms
# CSharp types added via Add-Type are supported
}

#add attributes that can be used with this transform
$SupportedAttributes = @('IsCriticalSystemObject')

# This is mandatory definition of transform that is expected by transform architecture
$prop=[Ordered]@{
BinaryInput=$false
SupportedAttributes=$SupportedAttributes
OnLoad = $null
OnSave = $null
}
$codeBlock = new-object PSCustomObject -property $prop
$codeBlock.OnLoad = {
param(
[object[]]$Values
)
Process
{
foreach($Value in $Values)
{
[Convert]::ToBoolean($value)
}
}
}
$codeBlock.OnSave = {
param(
[bool[]]$Values
)

Process
{
foreach($Value in $Values)
{
"$Value".ToUpper()
}
}
}
$codeBlock

52 changes: 52 additions & 0 deletions Transforms/Integer.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@

[CmdletBinding()]
param (
[Parameter()]
[Switch]
$FullLoad
)

if($FullLoad)
{
# Add any types that are used by transforms
# CSharp types added via Add-Type are supported
}

#add attributes that can be used with this transform
$SupportedAttributes = @('uSNChanged', 'uSNCreated','msDS-Approx-Immed-Subordinates','codePage','countryCode')

# This is mandatory definition of transform that is expected by transform architecture
$prop=[Ordered]@{
BinaryInput=$false
SupportedAttributes=$SupportedAttributes
OnLoad = $null
OnSave = $null
}
$codeBlock = new-object PSCustomObject -property $prop
$codeBlock.OnLoad = {
param(
[object[]]$Values
)
Process
{
foreach($Value in $Values)
{
[long]$Value
}
}
}
$codeBlock.OnSave = {
param(
[long[]]$Values
)

Process
{
foreach($Value in $Values)
{
"$Value"
}
}
}
$codeBlock

0 comments on commit 00c0f97

Please sign in to comment.