Last modified by jklein on 2025/06/16 08:23

From version 4.2
edited by jklein
on 2025/06/16 07:59
Change comment: There is no comment for this version
To version 2.1
edited by jklein
on 2025/06/16 07:55
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -13,10 +13,11 @@
13 13  
14 14  Welcher Datentyp in welchem Cmdlet verwendet werden muss, können Sie sich über die Hilfe des jeweiligen Cmdlets anzeigen lassen.
15 15  
16 -=== Beispiel 1: Get-Help ===
16 +=== Beispiel 1 ===
17 17  
18 -{{apimacro title="Get-Help"}}
19 -{{code language="PowerShell"}}
18 +{{code language="PowerShell" layout="LINENUMBERS" title="
19 +
20 + "}}
20 20  PS C:\Program Files (x86)\Aagon\AESB Shell> Get-Help Acmp-SaveContacts_V3
21 21  
22 22  NAME
... ... @@ -33,16 +33,38 @@
33 33  REMARKS
34 34   None
35 35  {{/code}}
36 -{{/apimacro}}
37 37  
38 38  An diesem Output ist ersichtlich, dass das Cmdlet eine Liste von **TContact_V3** erwartet. Es müssen also Kontakte mithilfe von **New-TContact_V3** erstellt und befüllt werden.
39 39  
40 -=== Beispiel 2: Speichern von Kontakten ===
40 +=== Beispiel 2 ===
41 41  
42 -{{apimacro title="Speichern von Kontakten"}}
43 -Text
44 -{{/apimacro}}
42 +{{code language="PowerShell" layout="LINENUMBERS" title="**Beispiel: Speichern von Kontakten**"}}
45 45  
44 +# Erstellen einer Liste
45 +$contacts = @()
46 +
47 +# Erstellen eines Kontakts
48 +$testContact = New-TContact_V3
49 +$testContact.ID = [guid]::NewGuid().ToString()
50 +$testContact.Name = "Max"
51 +$testContact.FamilyName = "Musterman"
52 +$testContact.Email = "mmusterman@testmail.de"
53 +
54 +# Hinzufügen des Kontakts zur Liste
55 +$contacts += $testContact
56 +
57 +# Ausführen des Public Api commands
58 +$result = Acmp-SaveContacts_V3 -Contacts $contacts
59 +
60 +# Ausgabe des results
61 +$result
62 +
63 +
64 +FirstErrorMsg ResultCode ResultMessage
65 +------------- ---------- -------------
66 + 0 OK
67 +{{/code}}
68 +
46 46  Anhand der Antwort der Public API ist eine Fehlerbehandlung möglich.
47 47  
48 48  
© Aagon GmbH 2025
Besuchen Sie unsere Aagon-Community