Computer.Volumes Property

Definition

Represents a collection of Volume objects.

public:
 property Microsoft::SqlServer::Management::Utility::VolumeCollection ^ Volumes { Microsoft::SqlServer::Management::Utility::VolumeCollection ^ get(); };
[Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObject(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerRelationship.ChildContainer, Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerCardinality.OneToAny, typeof(Microsoft.SqlServer.Management.Utility.Volume))]
public Microsoft.SqlServer.Management.Utility.VolumeCollection Volumes { get; }
[<Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcObject(Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerRelationship.ChildContainer, Microsoft.SqlServer.Management.Sdk.Sfc.Metadata.SfcContainerCardinality.OneToAny, typeof(Microsoft.SqlServer.Management.Utility.Volume))>]
member this.Volumes : Microsoft.SqlServer.Management.Utility.VolumeCollection
Public ReadOnly Property Volumes As VolumeCollection

Property Value

A VolumeCollection object that represents all the Volume objects defined on the computer.

Attributes

Examples

VC#

foreach (Volume vol in computer.Volumes)  
  {  
  System.Console.WriteLine(vol.Name);  
  }  

VB

For Each vol As Volume In computer.Volumes   
    System.Console.WriteLine(vol.Name)   
Next  

PowerShell

foreach($vol in $computer.Volumes)  
  {  
  Write-Host $vol.Name   
  }  

Remarks

Specific volumes can be referenced by using this collection. To add a new volume to the collection, call the constructor for the Volume object.

Applies to