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

PI Powershell

DeleteOrphans Class

  • Last UpdatedDec 15, 2025
  • 2 minute read
DeleteOrphans Class

Deletes orphaned child elements in the PISystem

The Delete-Orphans cmdlet allows you delete objects in the PISystem that have been orphaned. This includes any AF Elements objects that don't have a Parent Element defined.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellDeleteOrphans

Namespace:  OSIsoft.PowerShell
Assembly:  OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)

Syntax

[CmdletAttribute("Remove", "AFOrphans", SupportsShouldProcess = true)]
public class DeleteOrphans : OSICmdletBase
<CmdletAttribute("Remove", "AFOrphans", SupportsShouldProcess := true)>
Public Class DeleteOrphans
	Inherits OSICmdletBase

Dim instance As DeleteOrphans
[CmdletAttribute(L"Remove", L"AFOrphans", SupportsShouldProcess = true)]
public ref class DeleteOrphans : public OSICmdletBase
[<CmdletAttribute("Remove", "AFOrphans", SupportsShouldProcess = true)>]
type DeleteOrphans =  
    class
        inherit OSICmdletBase
    end

The DeleteOrphans type exposes the following members.

Constructors

  NameDescription
Public method
DeleteOrphans

Properties

  NameDescription
Public property
AFServer

Instance of the AFServer

Public property
Delay

Specify the number of minutes to delay before a modified orphaned object is deleted. The value should be greater or equal to zero.

Examples

$afServer | Remove-AFOrphans -Delay 0

Where:

$afServer = Get-AFServer -Name "AFServerMachineName"

Deletes all orphaned child element objects in the PISystem immediately (no delay).

See Also

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