Summary
Creates a new volume range.
Add-VolumeRange
-Entry
-IncludeVolume
Returns a volume range object.
Parameters
Parameter | Type | Required? | Notes |
---|---|---|---|
Entry | Volume range object | Yes | |
IncludeVolume | Switch | No, Defaults to | Adds the parent |
Examples
Create a new volume range
# Create a new volume range
# Create an object with the necessary fields to create the volume range
# A volume range requires a parent volume id, beg no, and end no fields.
$entry = @{
VolumeId = 10
BegNo = "A000001"
EndNo = "A999999"
}
# Create the volume range. The created entry will be returned back.
$data = Add-VolumeRange -Entry $entry
# Output some information to help indicate that the volume range was created
Write-Output "Volume range $($data.VolumeRangeId) ($($data.BegNo) - $($data.EndNo)) was created 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 (A000001 - A999999) was created on volume 10
JSON Results:
{
"VolumeRangeId": 22,
"VolumeId": 10,
"BegNo": "A000001",
"EndNo": "A999999",
"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:01:59.3193846+00:00",
"LastUpdatedBy": null,
"Volume": null
}