RemovePIValue Class
- Last UpdatedDec 15, 2025
- 5 minute read
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
InternalCommand
Cmdlet
PSCmdlet
OSIsoft.PowerShellOSICmdletBase
OSIsoft.PowerShellRemovePIValue
Namespace: OSIsoft.PowerShell
Assembly: OSIsoft.PowerShell (in OSIsoft.PowerShell.dll) Version: 2.2.3.0 (2.2.3.952)
Syntax
[CmdletAttribute("Remove", "PIValue", DefaultParameterSetName = "PointNameTimeValue", SupportsShouldProcess = true)] public class RemovePIValue : OSICmdletBase
<CmdletAttribute("Remove", "PIValue", DefaultParameterSetName := "PointNameTimeValue", SupportsShouldProcess := true)> Public Class RemovePIValue Inherits OSICmdletBase Dim instance As RemovePIValue
[CmdletAttribute(L"Remove", L"PIValue", DefaultParameterSetName = L"PointNameTimeValue", SupportsShouldProcess = true)] public ref class RemovePIValue : public OSICmdletBase
[<CmdletAttribute("Remove", "PIValue", DefaultParameterSetName = "PointNameTimeValue", SupportsShouldProcess = true)>] type RemovePIValue = class inherit OSICmdletBase end
The RemovePIValue type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| RemovePIValue |
Properties
| Name | Description | |
|---|---|---|
| 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. | |
| Connection | Specifies which connection to a PI Data Archive to use | |
| EndTime | End time to use when removing a range of values | |
| Event | Event or events to remove | |
| PIPoint | PIPoint object or PIPoint objects of the PI Point to remove values from | |
| PointId | The PointID or PointIDs of the PI Point(s) to remove values from | |
| PointName | The name or names of the PI Point(s) to remove values from | |
| StartTime | Start time to use when removing a range of values | |
| Stream | Stream object or stream objects of the PI Point to remove values from | |
| Time | Time or times to remove an event at | |
| 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 $conRemove 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.