本文整理匯總了C#中Pash.Implementation.ProviderRuntime.ThrowFirstErrorOrReturnResults方法的典型用法代碼示例。如果您正苦於以下問題:C# ProviderRuntime.ThrowFirstErrorOrReturnResults方法的具體用法?C# ProviderRuntime.ThrowFirstErrorOrReturnResults怎麽用?C# ProviderRuntime.ThrowFirstErrorOrReturnResults使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Pash.Implementation.ProviderRuntime
的用法示例。
在下文中一共展示了ProviderRuntime.ThrowFirstErrorOrReturnResults方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Copy
public Collection<PSObject> Copy(string[] path, string destinationPath, bool recurse, CopyContainers copyContainers,
bool force, bool literalPath)
{
var runtime = new ProviderRuntime(SessionState, force, literalPath);
Copy(path, destinationPath, recurse, copyContainers, runtime);
return runtime.ThrowFirstErrorOrReturnResults();
}
示例2: GetNames
public Collection<string> GetNames(string[] path, ReturnContainers returnContainers, bool recurse, bool force,
bool literalPath)
{
var runtime = new ProviderRuntime(SessionState, force, literalPath);
GetNames(path, returnContainers, recurse, runtime);
var packedResults = runtime.ThrowFirstErrorOrReturnResults();
var results = (from r in packedResults select r.ToString()).ToList();
return new Collection<string>(results);
}
示例3: Get
public Collection<PSObject> Get(string[] path, bool force, bool literalPath)
{
var runtime = new ProviderRuntime(SessionState, force, literalPath);
Get(path, runtime);
return runtime.ThrowFirstErrorOrReturnResults();
}
示例4: Rename
public Collection<PSObject> Rename(string path, string newName, bool force)
{
var runtime = new ProviderRuntime(SessionState, force, true);
Rename(path, newName, runtime);
return runtime.ThrowFirstErrorOrReturnResults();
}
示例5: New
public Collection<PSObject> New(string[] paths, string name, string itemTypeName, object content, bool force)
{
var runtime = new ProviderRuntime(SessionState, force, true);
New(paths, name, itemTypeName, content, runtime);
return runtime.ThrowFirstErrorOrReturnResults();
}
示例6: GetValidChildNames
internal List<string> GetValidChildNames(ContainerCmdletProvider provider, string providerPath, ReturnContainers returnContainers, ProviderRuntime runtime)
{
var subRuntime = new ProviderRuntime(runtime);
subRuntime.PassThru = false; // so we can catch the results
provider.GetChildNames(providerPath, returnContainers, subRuntime);
var results = subRuntime.ThrowFirstErrorOrReturnResults();
return (from c in results
where c.BaseObject is string
select ((string)c.BaseObject)).ToList();
}