Send-ToEasitGO
SYNOPSIS
Send one or more objects to Easit GO WebAPI.
SYNTAX
legacy
| Send-ToEasitGO [-Url] <String> [-Apikey] <String> [-ImportHandlerIdentifier] <String> -CustomItem <Hashtable>
[-SendInBatchesOf <Int32>] [-IDStart <Int32>] [-InvokeRestMethodParameters <Hashtable>]
[-ConvertToJsonParameters <Hashtable>] [-WriteBody] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
|
item
| Send-ToEasitGO [-Url] <String> [-Apikey] <String> [-ImportHandlerIdentifier] <String> -Item <Object[]>
[-SendInBatchesOf <Int32>] [-IDStart <Int32>] [-InvokeRestMethodParameters <Hashtable>]
[-ConvertToJsonParameters <Hashtable>] [-WriteBody] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
[<CommonParameters>]
|
DESCRIPTION
Create or update any object or objects in Easit GO.
This function can be used with any importhandler, module and object in Easit GO.
EXAMPLES
EXAMPLE 1
| $sendToEasitParams = @{
Url = 'https://go.easit.com'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
$customItem = @{prop1="value1";prop2="value2";prop3="value3"}
Send-ToEasitGO @sendToEasitParams -CustomItem $customItem
|
EXAMPLE 2
| $sendToEasitParams = @{
Url = 'https://go.easit.com/integration-api'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
SendInBatchesOf = 75
}
$csvData = Import-Csv -Path 'C:\Path\To\My\csvFile.csv' -Delimiter ';' -Encoding 'utf8'
Send-ToEasitGO @sendToEasitParams -Item $csvData
|
EXAMPLE 3
| $sendToEasitParams = @{
Url = 'https://go.easit.com/integration-api/items'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
$adObjects = Get-ADUser -Filter * -SearchBase 'OU=RootOU,DC=company,DC=com'
Send-ToEasitGO @sendToEasitParams -Item $adObjects
|
EXAMPLE 4
| $sendToEasitParams = @{
Url = 'https://go.easit.com'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
Get-ADUser -Filter * -SearchBase 'OU=RootOU,DC=company,DC=com' | Send-ToEasitGO @sendToEasitParams
|
EXAMPLE 5
| $sendToEasitParams = @{
Url = 'https://go.easit.com'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
Import-Csv -Path 'C:\Path\To\My\csvFile.csv' -Delimiter ';' -Encoding 'utf8' | Send-ToEasitGO @sendToEasitParams
|
EXAMPLE 6
| $sendToEasitParams = @{
Url = 'https://go.easit.com'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
$customItem = @{
prop1=@('value1','value4','value5')
prop2="value2"
prop3="value3"
}
Send-ToEasitGO @sendToEasitParams -CustomItem $customItem
|
EXAMPLE 7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 | $sendToEasitParams = @{
Url = 'https://go.easit.com'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
$customItem = @{
prop1=@{
name = 'propertyNameUsedAsnameInJSON'
value = 'propertyValue'
rawValue = 'propertyRawValue'
}
prop2="value2"
prop3="value3"
}
Send-ToEasitGO @sendToEasitParams -CustomItem $customItem
|
EXAMPLE 8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 | $sendToEasitParams = @{
Url = 'https://go.easit.com'
Apikey = 'myApikey'
ImportHandlerIdentifier = 'myImportHandler'
}
# File 1
$attachment1FileContent = Get-Content -Path $attachmentFile1 -Raw
$attachment1ByteArray = [System.Text.Encoding]::UTF8.GetBytes($attachment1FileContent)
$attachment1 = @{
name = (Get-ChildItem -Path $attachmentFile1).Name
value = [System.Convert]::ToBase64String($attachment1ByteArray)
}
#File 2
$attachment2FileContent = Get-Content -Path $attachmentFile2 -Raw
$attachment2ByteArray = [System.Text.Encoding]::UTF8.GetBytes($attachment2FileContent)
$attachment2 = @{
name = (Get-ChildItem -Path $attachmentFile2).Name
value = [System.Convert]::ToBase64String($attachment2ByteArray)
}
$customItem = @{
id=123
attachments=@($attachment1, $attachment2) # Add files to the 'attachments' array property
}
Send-ToEasitGO @sendToEasitParams -CustomItem $customItem
|
In this example we want to send 2 files to object with id 123.
PARAMETERS
-Apikey
Apikey used for authenticating to Easit GO.
| Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-ConvertToJsonParameters
Set of additional parameters for ConvertTo-Json.
Base parameters sent to ConvertTo-Json is 'Depth = 4', 'EscapeHandling = 'EscapeNonAscii'', 'WarningAction = 'SilentlyContinue''.
| Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-CustomItem
Hashtable of key-value-pair with the properties and its values that you want to send to Easit GO.
| Type: Hashtable
Parameter Sets: legacy
Aliases: CustomProperties
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-IDStart
Used as ID for first item in itemToImport array.
| Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 1
Accept pipeline input: False
Accept wildcard characters: False
|
-ImportHandlerIdentifier
ImportHandler to import data with.
| Type: String
Parameter Sets: (All)
Aliases: handler, ih, identifier
Required: True
Position: 3
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-InvokeRestMethodParameters
Set of additional parameters for Invoke-RestMethod.
Base parameters sent to Invoke-RestMethod is 'Uri','ContentType', 'Method', 'Body', 'Authentication' and 'Credential'.
| Type: Hashtable
Parameter Sets: (All)
Aliases: irmParams
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-Item
Item or items to send to Easit GO.
| Type: Object[]
Parameter Sets: item
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
|
-ProgressAction
Determines how PowerShell responds to progress updates generated by a script, cmdlet, or provider, such as the progress bars generated by the Write-Progress cmdlet. The Write-Progress cmdlet creates progress bars that show a command's status.
The ProgressAction parameter takes one of the ActionPreference enumeration values: SilentlyContinue, Stop, Continue, Inquire, Ignore, Suspend, or Break.
| Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-SendInBatchesOf
Number of items to include in each request sent to Easit GO.
| Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 50
Accept pipeline input: False
Accept wildcard characters: False
|
-Url
URL to Easit GO.
| Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-WriteBody
If specified the function will try to write the request body to a file in the current directory.
| Type: SwitchParameter
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False
|
-Confirm
Prompts you for confirmation before running the cmdlet.
| Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
-WhatIf
Shows what would happen if the cmdlet runs.
The cmdlet is not run.
| Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
|
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
OUTPUTS
NOTES