Partager via


DriveManagementIntrinsics.GetAtScope(String, String) Method

Definition

Gets the drive information for the drive specified by name.

public:
 System::Management::Automation::PSDriveInfo ^ GetAtScope(System::String ^ driveName, System::String ^ scope);
public System.Management.Automation.PSDriveInfo GetAtScope (string driveName, string scope);
member this.GetAtScope : string * string -> System.Management.Automation.PSDriveInfo
Public Function GetAtScope (driveName As String, scope As String) As PSDriveInfo

Parameters

driveName
String

The name of the drive to get the drive information for.

scope
String

The ID of the scope to get the drive from. This may be one of the scope keywords like global or local, or it may be an numeric offset of the scope generation relative to the current scope. If the scopeID is null or empty the local scope is used.

Returns

The drive information that represents the drive of the specified name.

Exceptions

If driveName is null.

If scope is less than zero, or not a number and not "script", "global", "local", or "private"

If scopeID is less than zero or greater than the number of currently active scopes.

Applies to