Set-VolumeRange

Prev Next

Summary

Updates an existing volume range.

Set-VolumeRange
    -Entry
    -IncludeVolume

Returns a volume range object.

Parameters

Parameter

Type

Required?

Notes

Entry

Volume range object

Yes


IncludeVolume

Switch

No, Defaults to false

Adds the parent Volume property to the output.

Examples

Update an existing volume range

# Update an existing volume range

# A common flow for updating existing data is to first retrieve the data using the GET
# command, update specific fields, and then provide the modified data back using the SET command.

$entry = Get-VolumeRange -Id 22

# Update the beg/end no fields:
$entry.BegNo = "B000001"
$entry.EndNo = "B999999"

# Save the modified volume range
$data = Set-VolumeRange -Entry $entry

# Output some information to help indicate that the volume range was updated
Write-Output "Volume range $($data.VolumeRangeId) ($($data.BegNo) - $($data.EndNo)) was updated on volume $($data.VolumeId)"

# For debug purposes, convert the data to output as JSON so we can see all the fields
Write-Output ""
Write-Output "JSON Results:"

$jsonOutput = $data | ConvertTo-Json -Depth 10

# Output the data
Write-Output $jsonOutput

Execution results:

Volume range 22 (B000001 - B999999) was updated on volume 10

JSON Results:
{
  "VolumeRangeId": 22,
  "VolumeId": 10,
  "BegNo": "B000001",
  "EndNo": "B999999",
  "CreatedByFullName": "Max Miller",
  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "CreatedOn": "2025-07-15T19:01:59.3193846+00:00",
  "CreatedBy": null,
  "LastUpdatedByFullName": "Max Miller",
  "LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",
  "LastUpdatedOn": "2025-07-15T19:09:22.5224673+00:00",
  "LastUpdatedBy": null,
  "Volume": null
}