diff --git a/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-List.ps1 b/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-List.ps1 new file mode 100644 index 0000000..5b59d33 --- /dev/null +++ b/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-List.ps1 @@ -0,0 +1,40 @@ + +function Get-List { + [CmdletBinding()] + param ( + #[Parameter(Mandatory=$false)][Hashtable] $InputHashtable + #[Parameter(Mandatory=$false)][Switch] $DebugMode = $false + #[Parameter(Mandatory=$true)][Int] $ListId + + ) + + begin { + + Invoke-EmarsysLogin + + } + + process { + + #| Out-GridView -PassThru | Select -first 20 +# $fields | Out-GridView +# #$fields | Export-Csv -Path ".\fields.csv" -Encoding Default -NoTypeInformation -Delimiter "`t" +# #$fields | Select @{name="field_id";expression={ $_.id }}, @{name="fieldname";expression={$_.name}} -ExpandProperty choices | Export-Csv -Path ".\fields_choices.csv" -Encoding Default -NoTypeInformation -Delimiter "`t" + +# $c = Invoke-emarsys -cred $cred -uri "$( $settings.base )field/translate/de" -method Get + + $emarsys = $Script:variableCache.emarsys + + $lists = $emarsys.getLists() + + $lists + + } + + end { + + } + +} + + diff --git a/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListContacts.ps1 b/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListContacts.ps1 index 59f4828..d3e3c2c 100644 --- a/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListContacts.ps1 +++ b/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListContacts.ps1 @@ -8,6 +8,8 @@ function Get-ListContacts { param ( #[Parameter(Mandatory=$false)][Hashtable] $InputHashtable #[Parameter(Mandatory=$false)][Switch] $DebugMode = $false + [Parameter(Mandatory=$true)][Int] $ListId + ) begin { @@ -27,7 +29,7 @@ function Get-ListContacts { $emarsys = $Script:variableCache.emarsys - $fetch = $emarsys.fetchListContacts("31000652") + $fetch = $emarsys.fetchListContacts([String]$ListId) $fetch diff --git a/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListCount.ps1 b/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListCount.ps1 index 4e91bb9..3ee1327 100644 --- a/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListCount.ps1 +++ b/AptecoPSFramework/plugins/emarsys/Public/emarsys/Get-ListCount.ps1 @@ -8,6 +8,8 @@ function Get-ListCount { param ( #[Parameter(Mandatory=$false)][Hashtable] $InputHashtable #[Parameter(Mandatory=$false)][Switch] $DebugMode = $false + [Parameter(Mandatory=$true)][Int] $ListId + ) begin { @@ -27,7 +29,7 @@ function Get-ListCount { $emarsys = $Script:variableCache.emarsys - $count = $emarsys.countList(31000652) + $count = $emarsys.countList($ListId) $count