Esempio n. 1
0
        public bool IsContainer(string path)
        {
            var  runtime = new ProviderRuntime(SessionState);
            bool result  = IsContainer(path, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(result);
        }
Esempio n. 2
0
        public bool Exists(string path, bool force, bool literalPath)
        {
            var  runtime = new ProviderRuntime(SessionState, force, literalPath);
            bool result  = Exists(path, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(result);
        }
Esempio n. 3
0
        public Collection <PathInfo> GetResolvedPSPathFromPSPath(string path)
        {
            var runtime = new ProviderRuntime(_sessionState);
            var res     = GetResolvedPSPathFromPSPath(new [] { path }, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(res);
        }
Esempio n. 4
0
        public PathInfo SetLocation(string path)
        {
            var runtime = new ProviderRuntime(_sessionState);
            var res     = SetLocation(path, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(res);
        }
Esempio n. 5
0
        public string ParseParent(string path, string root)
        {
            var runtime = new ProviderRuntime(_sessionState);
            var res     = ParseParent(path, root, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(res);
        }
Esempio n. 6
0
        public string ParseChildName(string path)
        {
            var runtime = new ProviderRuntime(_sessionState);
            var res     = ParseChildName(path, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(res);
        }
Esempio n. 7
0
        public string NormalizeRelativePath(string path, string basePath)
        {
            var runtime = new ProviderRuntime(_sessionState);
            var res     = NormalizeRelativePath(path, basePath, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(res);
        }
Esempio n. 8
0
        public Collection <PSObject> New(string[] paths, string name, string itemTypeName, object content, bool force)
        {
            // TODO: support globbing (e.g. * in filename)
            Path normalizedPath;
            var  runtime = new ProviderRuntime(_cmdlet.ExecutionContext);

            runtime.Force = force;
            foreach (var path in paths)
            {
                var provider = GetContainerProviderByPath(path, name, out normalizedPath);
                provider.NewItem(normalizedPath, itemTypeName, content, runtime);
            }
            runtime.ThrowFirstErrorOrContinue();
            return(runtime.RetreiveAllProviderData());
        }