UndoAFCheckOut Class
- Last UpdatedDec 15, 2025
- 3 minute read
Undo a check out of AF objects
The Undo-AFCheckOut cmdlet will undo check outs of AF objects that are checked out. Essentially, this will discard any changes made to the AF objects since the last successful check in.
Inheritance Hierarchy
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellUndoAFCheckOut
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)
Syntax
[CmdletAttribute("Undo", "AFCheckOut", SupportsShouldProcess = true)] public class UndoAFCheckOut : OSICmdletBase
<CmdletAttribute("Undo", "AFCheckOut", SupportsShouldProcess := true)> Public Class UndoAFCheckOut Inherits OSICmdletBase Dim instance As UndoAFCheckOut
[CmdletAttribute(L"Undo", L"AFCheckOut", SupportsShouldProcess = true)] public ref class UndoAFCheckOut : public OSICmdletBase
[<CmdletAttribute("Undo", "AFCheckOut", SupportsShouldProcess = true)>] type UndoAFCheckOut = class inherit OSICmdletBase end
The UndoAFCheckOut type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| UndoAFCheckOut |
Properties
| Name | Description | |
|---|---|---|
| AFDatabase | AF Database to undo check out | |
| AFServer | AF Server to undo check out | |
| Force | Force undo check out even if checked out by another user | |
| ItemToUndoCheckOut | AF Objects to undo check out | |
| PassThru | Returns objects that were changed. By default, this cmdlet does not generate any output |
Examples
Undo-AFCheckOut -AFDatabase $afDB -Force
Where:
$afDB = Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")
Undo the checkout of the AF Database "AFDatabase1" on the AF Server "PIAF1". The -Force parameter is specified so this will also undo any check out of AF objects under the database object that were checked out by other users.
Examples
Undo-AFCheckOut -ItemsToCheckOut $MyAFElement -PassThrough
Where:
$afDB = Get-AFDatabase -Name "AFDatabase1" -AFServer (Get-AFServer -Name "PIAF1")
$MyRenamedAFElement = Set-AFElement -NewName "IncorrectlyRenamedElement" -AFElement $MyAFElement -PassThrough
In this example, an AF Element stored in $MyAFElement was incorrectly renamed to "IncorrectlyRenamedElement" with the Set-AFElement cmdlet. Because this change was not immediately checked in with the -CheckIn parameter, we can undo the check out as shown above.