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

PI Powershell

RemovePIValue Class

  • Last UpdatedDec 15, 2025
  • 5 minute read
RemovePIValue Class

Remove a PI Value or Values from a PI Data Archive.

The Remove-PIValue cmdlet will remove one or more PI Values to the specified PI Data Archive. If multiple values are being removed, the number of values in the arrays that are passed in must be either 1 or the same number as each other.

Inheritance Hierarchy

SystemObject
  InternalCommand
    Cmdlet
      PSCmdlet
        OSIsoft.PowerShellOSICmdletBase
          OSIsoft.PowerShellOSICmdletBaseWithConnection
            OSIsoft.PowerShellRemovePIValue

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

Syntax

[CmdletAttribute("Remove", "PIValue", DefaultParameterSetName = "PointNameTimeValue", 
	SupportsShouldProcess = true)]
public class RemovePIValue : OSICmdletBaseWithConnection
<CmdletAttribute("Remove", "PIValue", DefaultParameterSetName := "PointNameTimeValue", 
	SupportsShouldProcess := true)>
Public Class RemovePIValue
	Inherits OSICmdletBaseWithConnection

Dim instance As RemovePIValue
[CmdletAttribute(L"Remove", L"PIValue", DefaultParameterSetName = L"PointNameTimeValue", 
	SupportsShouldProcess = true)]
public ref class RemovePIValue : public OSICmdletBaseWithConnection
[<CmdletAttribute("Remove", "PIValue", DefaultParameterSetName = "PointNameTimeValue", 
	SupportsShouldProcess = true)>]
type RemovePIValue =  
    class
        inherit OSICmdletBaseWithConnection
    end

The RemovePIValue type exposes the following members.

Constructors

  NameDescription
Public method
RemovePIValue

Properties

  NameDescription
Public property
Buffer

Remove the value or values through PI Buffer Subsystem. If an unsupported version of buffering is being used, or buffering is not installed, an error will be returned.

Public property
Connection

Specifies which connection to a PI Data Archive to use

(Overrides OSICmdletBaseWithConnectionConnection.)
Public property
EndTime

End time to use when removing a range of values

Public property
Event

Event or events to remove

Public property
PIPoint

PIPoint object or PIPoint objects of the PI Point to remove values from

Public property
PointId

The PointID or PointIDs of the PI Point(s) to remove values from

Public property
PointName

The name or names of the PI Point(s) to remove values from

Public property
StartTime

Start time to use when removing a range of values

Public property
Stream

Stream object or stream objects of the PI Point to remove values from

Public property
Time

Time or times to remove an event at

Public property
Value

The value or values to remove

Examples

Remove-PIValue -PointName Sinusoid -Time "1-Aug-2017 11:00:00" -Value 100 -Connection $con

Remove PI Value at a Specified Time Using PointName:

This example will remove a value of 100 at a timestamp of "1-Aug-2017 11:00:00" from the Sinusoid tag on the PI Data Archive specified in the -Connection.

Examples

Remove-PIValue -PIPoint (Get-PIPoint -Name Sinusoid -Connection $con) -Time "1-Aug-2017 11:00:00" -Value 100

Remove PI Value at a Specified Time Using PIPoint object:

This example will remove a value of 100 at a timestamp of "1-Aug-2017 11:00:00" from the Sinusoid tag. The PI Point for which to remove the value is obtained using Get-PIPoint and passed to the -PIPoint parameter. Run "Get-Help Get-PIPoint" for more information on this cmdlet.

Examples

Remove-PIValue -Connection $con -Event (Get-PIValue -PointName Sinusoid -StartTime "01-Jul-2017 00:00:00" -EndTime "02-Jul-2017 00:00:00")

Remove a Range of Events Using Event:

This example will remove the values from the PI Point Sinusoid for the time range of 01-Jul to 02-Jul. The values to be removed are first obtained using Get-PIValue and the resulting events are passed to the -Event parameter to be removed.

Examples

Remove-PIValue -PointName Sinusoid,SinusoidU,CDT158 -Time (ConvertFrom-AFRelativeTime -RelativeTime T+8h) -Value 100 -Connection $con

Remove PI Value at a Specified Time Using PointName for Multiple Tags:

This example will remove a value of 100 at a timestamp of "Today at 8:00am" from the tags in the PointName array: Sinusoid, SinusoidU, and CDT158.

Examples

Remove-PIValue -PointName Sinusoid,SinusoidU,CDT158 -Time "01-Aug-2017 10:00:00","01-Aug-2017 11:00:00","01-Aug-2017 9:00:00" -Value 100,200,300 -Connection $con

Remove PI Values at a Specified Times Using PointName for Multiple Tags:

This example will remove a value of 100 at a timestamp of 01-Aug-2017 10:00:00 from Sinusoid, a value of 200 at 01-Aug-2017 11:00:00 from SinusoidU, and a value of 300 at a timestamp of 01-Aug-2017 9:00:00 for CDT158.

Note that in this case the PointName, Time, and Value arrays all have the same number of elements (3). Therefore, each first element is associated with each other, each second element is associated with each other, etc.

Examples

Remove-PIValue -Event (Get-PIValue -PointName sinusoid -StartTime (ConvertFrom-AFRelativeTime *-4h) -EndTime (ConvertFrom-AFRelativeTime *) -Connection $con | Where-Object -Property Value -IsNot [System.Single]) -Connection $con

Remove Digital State Values for a PI Point for a Time Range:

This example will remove all digital state values found in the last four hours for the PI Point Sinusoid. The digital state values are determined by checking the Value object type of events returned by Get-PIValue. If they are not of type [System.Single], which corresponds to a PI Value type of "Float32", then they will be removed. Assuming this tag is of type Float32, the digital state values will be removed from the archives for the PI Point Sinusoid.

See Also

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