Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

PI Powershell

UndoAFCheckOut Class

  • Last UpdatedDec 15, 2025
  • 3 minute read
UndoAFCheckOut Class

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

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellUndoAFCheckOut

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 3.1.1.0 (3.1.1.466)

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

  NameDescription
Public method
UndoAFCheckOut

Properties

  NameDescription
Public property
AFDatabase

AF Database to undo check out

Public property
AFServer

AF Server to undo check out

Public property
Force

Force undo check out even if checked out by another user

Public property
ItemToUndoCheckOut

AF Objects to undo check out

Public property
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.

See Also

TitleResults for “How to create a CRG?”Also Available in