Restore-RDMEntryHistory
Synopsis
Revert an entry to a previous version
Syntax
__AllParameterSets
Restore-RDMEntryHistory [-History] <PSConnectionHistory> [-PassThru]
[-ForcePromptAnswer <DialogResult[]>] [-WhatIf] [-Confirm] [<CommonParameters>]Description
Revert a live entry to one of its previous versions, obtained from Get-RDMEntryHistory. The current password history is preserved and the version's embedded document, if any, is restored. If the version's folder differs from the entry's current folder, the entry keeps its current folder and a warning is raised instead of the interactive prompt shown by the Windows client.
Examples
Example 1
PS C:\> Get-RDMEntryHistory -InputObject $id | Where-Object ModifiedDate -eq $target | Restore-RDMEntryHistory -PassThruRevert the entry to a specific version and return the reverted entry.
Example 2
PS C:\> $currentUserName = ([xml](Get-RDMEntry $id | ConvertTo-RDMEntryXml)).Connection.Credentials.UserName
foreach ($version in Get-RDMEntryHistory -InputObject $id) {
$versionUserName = ([xml]($version | ConvertTo-RDMEntryXml)).Connection.Credentials.UserName
if ($versionUserName -eq $currentUserName) {
continue
}
$version | Restore-RDMEntryHistory
break
}Revert the entry to the last version before its username was changed.
Parameters
-Confirm
Prompts for confirmation before running the cmdlet.
-ForcePromptAnswer
Switch to use with caution. It will automatically answer prompt asking yes/no, yes/no/cancel, or ok/cancel questions. In case of multiple prompts, multiple values can be passed to this parameter. Here are the accepted values:
Yes: Accept the prompt. Cover the OK and Automatic value.
No: Refuse the yes/no/cancel prompt. "Cancel" is the fallback option if there is no "No" option.
Cancel: Cancel the yes/no/cancel prompt. "No" is the fallback option if there is no "Cancel" option.
-History
The version to revert to, obtained from Get-RDMEntryHistory
-PassThru
Return the reverted entry.
-WhatIf
Shows what would happen if the cmdlet were to run. The cmdlet does not run.
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
RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnectionHistory
A version obtained from Get-RDMEntryHistory
Outputs
RemoteDesktopManager.PowerShellModule.PSOutputObject.PSConnection
The reverted entry, when -PassThru is specified
Notes
For more information, type "Get-Help Restore-RDMEntryHistory -detailed". For technical information, type "Get-Help Restore-RDMEntryHistory -full".
Last updated
Was this helpful?