Skip to content

Commit 442cbfe

Browse files
authored
Merge pull request #34 from davidseibel/dev
Version 5.3.0
2 parents b953f67 + 4f84737 commit 442cbfe

40 files changed

+143
-140
lines changed

AutoMatePS.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
RootModule = 'AutomatePS.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '5.2.0'
15+
ModuleVersion = '5.3.0'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()
@@ -30,7 +30,7 @@ CompanyName = 'Unknown'
3030
Copyright = '(c) AutomatePS. All rights reserved.'
3131

3232
# Description of the functionality provided by this module
33-
Description = 'AutomatePS provides PowerShell integration with HelpSystems Automate Enterprise'
33+
Description = 'AutomatePS provides PowerShell integration with Fortra Automate'
3434

3535
# Minimum version of the PowerShell engine required by this module
3636
PowerShellVersion = '5.0'

Functions/Public/Add-AMConstant.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ function Add-AMConstant {
6565
$shouldUpdate = $false
6666
if ($updateObject.Constants.Name -notcontains $Name) {
6767
switch ((Get-AMConnection -ConnectionAlias $obj.ConnectionAlias).Version.Major) {
68-
10 { $newConstant = [AMConstantv10]::new($obj.ConnectionAlias) }
69-
{$_ -in 11,22} { $newConstant = [AMConstantv11]::new($obj.ConnectionAlias) }
70-
default { throw "Unsupported server major version: $_!" }
68+
10 { $newConstant = [AMConstantv10]::new($obj.ConnectionAlias) }
69+
{$_ -in 11,22,23} { $newConstant = [AMConstantv11]::new($obj.ConnectionAlias) }
70+
default { throw "Unsupported server major version: $_!" }
7171
}
7272
$newConstant.ParentID = $updateObject.ID
7373
$newConstant.Name = $Name

Functions/Public/Add-AMEmailConditionFilter.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ function Add-AMEmailConditionFilter {
5858
}
5959
}
6060
switch ((Get-AMConnection -ConnectionAlias $obj.ConnectionAlias).Version.Major) {
61-
10 { $emailFilter = [AMEmailFilterv10]::new() }
62-
{$_ -in 11,22} { $emailFilter = [AMEmailFilterv11]::new() }
63-
default { throw "Unsupported server major version: $_!" }
61+
10 { $emailFilter = [AMEmailFilterv10]::new() }
62+
{$_ -in 11,22,23} { $emailFilter = [AMEmailFilterv11]::new() }
63+
default { throw "Unsupported server major version: $_!" }
6464
}
6565
$emailFilter.FieldName = $FieldName
6666
$emailFilter.FieldValue = $FieldValue

Functions/Public/Add-AMSnmpConditionCredential.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ function Add-AMSnmpConditionCredential {
5050
if (($obj.Type -eq "Condition") -and ($obj.TriggerType -eq [AMTriggerType]::SNMPTrap)) {
5151
$updateObject = Get-AMCondition -ID $obj.ID -Connection $obj.ConnectionAlias
5252
switch ((Get-AMConnection -ConnectionAlias $obj.ConnectionAlias).Version.Major) {
53-
10 { $credential = [AMSNMPTriggerCredentialv10]::new() }
54-
{$_ -in 11,22} { $credential = [AMSNMPTriggerCredentialv11]::new() }
53+
10 { $credential = [AMSNMPTriggerCredentialv10]::new() }
54+
{$_ -in 11,22,23} { $credential = [AMSNMPTriggerCredentialv11]::new() }
5555
default { throw "Unsupported server major version: $_!" }
5656
}
5757
if ($PSBoundParameters.ContainsKey("User")) {

Functions/Public/Add-AMWorkflowItem.ps1

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -122,17 +122,17 @@ function Add-AMWorkflowItem {
122122
"ByConstruct" {
123123
if ($Item.Type -eq "Condition") {
124124
switch ($connection.Version.Major) {
125-
10 { $newItem = [AMWorkflowTriggerv10]::new($obj.ConnectionAlias) }
126-
{$_ -in 11,22} { $newItem = [AMWorkflowTriggerv11]::new($obj.ConnectionAlias) }
127-
default { throw "Unsupported server major version: $_!" }
125+
10 { $newItem = [AMWorkflowTriggerv10]::new($obj.ConnectionAlias) }
126+
{$_ -in 11,22,23} { $newItem = [AMWorkflowTriggerv11]::new($obj.ConnectionAlias) }
127+
default { throw "Unsupported server major version: $_!" }
128128
}
129129
$newItem.TriggerType = $Item.TriggerType
130130
$isTrigger = $true
131131
} else {
132132
switch ($connection.Version.Major) {
133-
10 { $newItem = [AMWorkflowItemv10]::new($obj.ConnectionAlias) }
134-
{$_ -in 11,22} { $newItem = [AMWorkflowItemv11]::new($obj.ConnectionAlias) }
135-
default { throw "Unsupported server major version: $_!" }
133+
10 { $newItem = [AMWorkflowItemv10]::new($obj.ConnectionAlias) }
134+
{$_ -in 11,22,23} { $newItem = [AMWorkflowItemv11]::new($obj.ConnectionAlias) }
135+
default { throw "Unsupported server major version: $_!" }
136136
}
137137
}
138138
# Workflows don't use an agent, so there's no reason to set it
@@ -144,17 +144,17 @@ function Add-AMWorkflowItem {
144144
}
145145
"ByEvaluation" {
146146
switch ($connection.Version.Major) {
147-
10 { $newItem = [AMWorkflowConditionv10]::new($obj.ConnectionAlias) }
148-
{$_ -in 11,22} { $newItem = [AMWorkflowConditionv11]::new($obj.ConnectionAlias) }
149-
default { throw "Unsupported server major version: $_!" }
147+
10 { $newItem = [AMWorkflowConditionv10]::new($obj.ConnectionAlias) }
148+
{$_ -in 11,22,23} { $newItem = [AMWorkflowConditionv11]::new($obj.ConnectionAlias) }
149+
default { throw "Unsupported server major version: $_!" }
150150
}
151151
$newItem.Expression = $Expression
152152
}
153153
"ByWait" {
154154
switch ($connection.Version.Major) {
155-
10 { $newItem = [AMWorkflowItemv10]::new($obj.ConnectionAlias) }
156-
{$_ -in 11,22} { $newItem = [AMWorkflowItemv11]::new($obj.ConnectionAlias) }
157-
default { throw "Unsupported server major version: $_!" }
155+
10 { $newItem = [AMWorkflowItemv10]::new($obj.ConnectionAlias) }
156+
{$_ -in 11,22,23} { $newItem = [AMWorkflowItemv11]::new($obj.ConnectionAlias) }
157+
default { throw "Unsupported server major version: $_!" }
158158
}
159159
$newItem.ConstructType = [AMConstructType]::Wait
160160
}

Functions/Public/Add-AMWorkflowLink.ps1

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,10 @@ function Add-AMWorkflowLink {
8484
if ($LinkType -ne [AMLinkType]::Result) {
8585
$ResultType = [AMLinkResultType]::Default
8686
$Value = ""
87-
} elseif ($ResultType -ne [AMLinkResultType]::Value) {
88-
$Value = ""
87+
} else {
88+
if ($ResultType -ne [AMLinkResultType]::Value) {
89+
$Value = $ResultType.ToString()
90+
}
8991
}
9092
}
9193

@@ -133,9 +135,9 @@ function Add-AMWorkflowLink {
133135
}
134136

135137
switch ((Get-AMConnection -ConnectionAlias $obj.ConnectionAlias).Version.Major) {
136-
10 { $newLink = [AMWorkflowLinkv10]::new($obj.ConnectionAlias) }
137-
{$_ -in 11,22} { $newLink = [AMWorkflowLinkv11]::new($obj.ConnectionAlias) }
138-
default { throw "Unsupported server major version: $_!" }
138+
10 { $newLink = [AMWorkflowLinkv10]::new($obj.ConnectionAlias) }
139+
{$_ -in 11,22,23} { $newLink = [AMWorkflowLinkv11]::new($obj.ConnectionAlias) }
140+
default { throw "Unsupported server major version: $_!" }
139141
}
140142
$newLink.ParentID = $updateObject.ID
141143
$newLink.DestinationID = $destination.ID
@@ -146,11 +148,7 @@ function Add-AMWorkflowLink {
146148
$newLink.SourceID = $source.ID
147149
$newLink.SourcePoint.x = $source.X
148150
$newLink.SourcePoint.y = $source.Y
149-
if ($ResultType -eq [AMLinkResultType]::Value) {
150-
$newLink.Value = $Value
151-
} else {
152-
$newLink.Value = $ResultType.ToString()
153-
}
151+
$newLink.Value = $Value
154152
$newLink.WorkflowID = $updateObject.ID
155153
$updateObject.Links += $newLink
156154
Set-AMWorkflow -Instance $updateObject

Functions/Public/Add-AMWorkflowVariable.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ function Add-AMWorkflowVariable {
9292

9393
if ($updateObject.Variables.Name -notcontains $Name) {
9494
switch ((Get-AMConnection -ConnectionAlias $obj.ConnectionAlias).Version.Major) {
95-
10 { $newVariable = [AMWorkflowVariablev10]::new($obj.ConnectionAlias) }
96-
{$_ -in 11,22} { $newVariable = [AMWorkflowVariablev11]::new($obj.ConnectionAlias) }
97-
default { throw "Unsupported server major version: $_!" }
95+
10 { $newVariable = [AMWorkflowVariablev10]::new($obj.ConnectionAlias) }
96+
{$_ -in 11,22,23} { $newVariable = [AMWorkflowVariablev11]::new($obj.ConnectionAlias) }
97+
default { throw "Unsupported server major version: $_!" }
9898
}
9999
$newVariable.Name = $Name
100100
$newVariable.ParentID = $updateObject.ID

Functions/Public/Copy-AMCondition.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ function Copy-AMCondition {
148148
default { throw "Unsupported trigger type '$($obj.TriggerType)' encountered!" }
149149
}
150150
}
151-
{$_ -in 11,22} {
151+
{$_ -in 11,22,23} {
152152
switch ($obj.TriggerType) {
153153
"Database" { $copyObject = [AMDatabaseTriggerv11]::new($Name, $Folder, $Connection.Alias) }
154154
"Email" {

Functions/Public/Copy-AMProcess.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ function Copy-AMProcess {
8989

9090
if (-not $PSBoundParameters.ContainsKey("Name")) { $Name = $obj.Name }
9191
switch ($Connection.Version.Major) {
92-
10 { $copyObject = [AMProcessv10]::new($Name, $Folder, $Connection.Alias) }
93-
{$_ -in 11,22} { $copyObject = [AMProcessv11]::new($Name, $Folder, $Connection.Alias) }
94-
default { throw "Unsupported server major version: $_!" }
92+
10 { $copyObject = [AMProcessv10]::new($Name, $Folder, $Connection.Alias) }
93+
{$_ -in 11,22,23} { $copyObject = [AMProcessv11]::new($Name, $Folder, $Connection.Alias) }
94+
default { throw "Unsupported server major version: $_!" }
9595
}
9696

9797
if ($PSBoundParameters.ContainsKey("Connection") -and $obj.ConnectionAlias -ne $Connection.Alias) {

Functions/Public/Copy-AMTask.ps1

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,9 @@ function Copy-AMTask {
9292

9393
if (-not $PSBoundParameters.ContainsKey("Name")) { $Name = $obj.Name }
9494
switch ($Connection.Version.Major) {
95-
10 { $copyObject = [AMTaskv10]::new($Name, $Folder, $Connection.Alias) }
96-
{$_ -in 11,22} { $copyObject = [AMTaskv11]::new($Name, $Folder, $Connection.Alias) }
97-
default { throw "Unsupported server major version: $_!" }
95+
10 { $copyObject = [AMTaskv10]::new($Name, $Folder, $Connection.Alias) }
96+
{$_ -in 11,22,23} { $copyObject = [AMTaskv11]::new($Name, $Folder, $Connection.Alias) }
97+
default { throw "Unsupported server major version: $_!" }
9898
}
9999

100100
if ($PSBoundParameters.ContainsKey("Connection") -and $obj.ConnectionAlias -ne $Connection.Alias) {

0 commit comments

Comments
 (0)