< Back

Set-AemDeviceUdf

Sat Jul 18, 2020 3:59 pm

NAME
Set-AemDeviceUdf

SYNOPSIS


SYNTAX
Set-AemDeviceUdf [-AccessToken] <String> [-DeviceUid] <String> [-UdfData] <Hashtable> [[-ApiUrl] <String>] [[-EventLogSource] <String>] [[-LogPath] <String>] [<CommonParameters>]


DESCRIPTION
Sets the user defined fields of the device.


PARAMETERS
-AccessToken <String>
Mandatory parameter. Represents the token returned once successful authentication to the API is achieved. Use New-AemApiAccessToken to obtain the token.

Required? true
Position? 1
Default value
Accept pipeline input? false
Accept wildcard characters? false

-DeviceUid <String>
Represents the UID number (e.g. 9fd7io7a-fe95-44k0-9cd1-fcc0vcbc7900) of the desired device.

Required? true
Position? 2
Default value
Accept pipeline input? false
Accept wildcard characters? false

-UdfData <Hashtable>
A hash table pairing the udfs and their intended values.

Required? true
Position? 3
Default value
Accept pipeline input? false
Accept wildcard characters? false

-ApiUrl <String>
Default value is 'https://zinfandel-api.centrastage.net'. Represents the URL to AutoTask's AEM API, for the desired instance.

Required? false
Position? 4
Default value https://zinfandel-api.centrastage.net
Accept pipeline input? false
Accept wildcard characters? false

-EventLogSource <String>
When included, (and when LogPath is null), represents the event log source for the Application log. If no event log source or path are provided, output is sent only to the host.

Required? false
Position? 5
Default value
Accept pipeline input? false
Accept wildcard characters? false

-LogPath <String>
When included (when EventLogSource is null), represents the file, to which the cmdlet will output will be logged. If no path or event log source are provided, output is sent only to the host.

Required? false
Position? 6
Default value
Accept pipeline input? false
Accept wildcard characters? false

<CommonParameters>
This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer, PipelineVariable, and OutVariable. For more information, see
about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

NOTES


Author: Konstantin Kaminskiy
V1.0.0.0 date: 5 November 2018
- Initial release.
V1.0.0.1 date: 21 November 2018
- Updated white space.
- Changed Out-Null to $null.
V1.0.0.2 date: 5 December 2019
V1.0.0.3 date: 11 December 2019

-------------------------- EXAMPLE 1 --------------------------

PS C:\>$udfs = @{

'udf1' = "String One"
'udf2' = "String Two"
}
Set-AemDeviceUDF -AccessToken $token -DeviceUID $deviceUid -UdfData $udfs

This will set the udfs to the values provided in $udfs.




-------------------------- EXAMPLE 2 --------------------------

PS C:\>$udfs = Get-AemDevices -AccessToken $token -DeviceId '764402' | Select-Object -ExpandProperty udf

$newudfs = @{'udf6' = "$($udfs.udf6) - This data should be added"}
Set-AemDeviceUDF -AccessToken $token -DeviceUid $uid -UdfData $newudfs -Verbose

This will append to the udfs for the device.





RELATED LINKS
https://github.com/wetling23/Public.AEM ... hellModule