Exemple #1
0
        private CmdletProvider GetProviderByPath(string path)
        {
            // MUST: implement for "dir"
            if (string.IsNullOrEmpty(path))
            {
                path = CurrentLocation.Path;
            }

            string driveName = PathIntrinsics.GetDriveFromPath(path);

            PSDriveInfo drive = GetDrive(driveName, null);

            if (drive == null)
            {
                return(null);
            }

            return(GetProviderInstance(drive.Provider.Name));
        }