You can find sample scripts in "C:\Program Files (x86)\SolarWinds\Orion SDK\Samples\PowerShell". We have examples for adding nodes and interfaces. Orion.Volumes can be created in the same way with its properties assigned.
I have provided an sample powershell script for creating volumes.
$Target="localhost" |
# Connect to SWIS with default admin credentials
$swis = Connect-Swis -host $Target -UserName admin -Password ""
$newVolumeProps = @{ | |
NodeID="4"; | |
VolumeType="RAM"; | |
VolumeSize="345234"; | |
Icon="RAM.gif"; | |
Index="1"; | |
Caption="RAM Caption"; | |
VolumeDescription="D:\"; | |
PollInterval="120"; | |
StatCollection="10"; | |
RediscoveryInterval="20"; | |
StatusIcon="Up.gif"; | |
FullName="D:\ RAM Caption"; | |
Responding=""; | |
VolumePercentUsed=""; | |
VolumeAllocationFailuresThisHour=""; | |
VolumeSpaceUsed=""; | |
VolumeAllocationFailuresToday=""; | |
VolumeSpaceAvailable=""; | |
DiskQueueLength=""; | |
DiskTransfer=""; | |
DiskReads=""; | |
DiskWrites=""; | |
TotalDiskIOPS=""; | |
} |
$newUri = New-SwisObject $swis –EntityType "Orion.Volumes" –Properties $newVolumeProps |