Update-DSEntryBase
2025-01-30
Update-DSEntryBase
SYNOPSIS
Update an entry.
SYNTAX
Value
Update-DSEntryBase [-JsonBody] <string> [-AsLegacyResponse] [<CommonParameters>]
RDMConnection
Update-DSEntryBase [-FromRDMConnection] <ConnectionInfoEntity> [-AsLegacyResponse]
[<CommonParameters>]
ALIASES
This cmdlet has the following aliases,
DESCRIPTION
Update an entry (Modified entry should be in jsonBody). Unless you know exactly what you are doing, you should probably use the CMDlets created by us to update entries.
EXAMPLES
EXAMPLE 1
PS C:> $credResponse = Get-DSEntry -EntryID $id $cred = $credResponse.data $cred.data.passwordItem | Add-Member -MemberType NoteProperty -Name SensitiveData -Value 'newPassword' Update-DSEntryBase -JsonBody (ConvertTo-Json -InputObject $cred -Depth 4)
An existing credential entry with an existing password is fetched. Its password is changed to 'newPassword' by adding a sensitive data property to passwordItem. The entry is converted in json with the requiered depth to avoid being flatten. The entry is updated afterwards.
EXAMPLE 2
PS C:> $credResponse = Get-DSEntry -EntryID $id $cred = $credResponse.data $cred.data.passwordItem | Add-Member -MemberType NoteProperty -Name SensitiveData -Value 'newPassword' Update-DSEntryBase -JsonBody (ConvertTo-Json -InputObject $cred -Depth 4)
An existing credential entry with an existing password is fetched. Its password is changed to 'newPassword' by adding a sensitive data property to passwordItem. The entry is converted in json with the requiered depth to avoid being flatten. The entry is updated afterwards.
EXAMPLE 3
PS C:> $entryID = '12345678-1234-1234-1234-123456781234'
PS C:> $entry = Get-DSEntry -EntryID $entryID
PS C:> $entry.data.vpn = @{
application = [Devolutions.RemoteDesktopManager.VPNApplication]::DevolutionsGateway
closeMode = [Devolutions.RemoteDesktopManager.VPNCloseMode]::OnDisconnect
devolutionsGatewayID = '6ccf937c-7a98-4106-b951-815471ec649b'
mode = [Devolutions.RemoteDesktopManager.VPNMode]::AlwaysConnect
enableAutoDetectIsOnlineVPN = 2
}
PS C:> Update-DSEntryBase -JsonBody (ConvertTo-Json -InputObject $entry -Depth 10)
Set the default Devolutions Gateway on the entry with the connect mode 'Always Connect' and the close mode 'On session close'
PARAMETERS
-AsLegacyResponse
In versions prior to 2024.2, many DS cmdlets returned a ServerResponse object. Enabling this backward compatibility switch allows scripts developed for earlier versions to function correctly.
Type: System.Management.Automation.SwitchParameter
DefaultValue: ''
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
- Name: (All)
Position: Named
IsRequired: false
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-FromRDMConnection
Entry obtained from Get-DSEntry -AsRDMConnection. It can be used to update an entry
Type: Devolutions.RemoteDesktopManager.Business.Entities.ConnectionInfoEntity
DefaultValue: ''
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
- Name: RDMConnection
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
-JsonBody
Entry in JSON
Type: System.String
DefaultValue: ''
SupportsWildcards: false
ParameterValue: []
Aliases: []
ParameterSets:
- Name: Value
Position: 1
IsRequired: true
ValueFromPipeline: false
ValueFromPipelineByPropertyName: false
ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''
CommonParameters
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.
INPUTS
OUTPUTS
RemoteDesktopManager.PowerShellModule.Private.ServerResponse
NOTES
For more information, type "Get-Help Update-DSEntryBase -detailed". For technical information, type "Get-Help Update-DSEntryBase -full".