Exemple #1
0
        public bool IsContainer(string path)
        {
            var  runtime = new ProviderRuntime(SessionState);
            bool result  = IsContainer(path, runtime);

            runtime.ThrowFirstErrorOrContinue();
            return(result);
        }
Exemple #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);
        }
Exemple #3
0
        public Collection <PathInfo> GetResolvedPSPathFromPSPath(string path)
        {
            var runtime = new ProviderRuntime(_sessionState);
            var res     = GetResolvedPSPathFromPSPath(new [] { path }, runtime);

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

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

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

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

            runtime.ThrowFirstErrorOrContinue();
            return(res);
        }
Exemple #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());
        }