[英]The term 'Connect-AzureAD' is not recognized as the name of a cmdlet
[英]The term 'connect-QADService' is not recognized as the name of a cmdlet… inside C# function
有人可以帮忙理解为什么Csharp函数中包含以下代码的原因
Runspace runspace = RunspaceFactory.CreateRunspace();
runspace.Open();
Pipeline pipe = runspace.CreatePipeline();
Command connectToActDir = new Command("connect-QADService");
connectToActDir.Parameters.Add("Service", "'ip:port'");
connectToActDir.Parameters.Add("ConnectionAccount", "'user.local\administrator'");
connectToActDir.Parameters.Add("ConnectionPassword", "'password'");
pipe.Commands.Add(connectToActDir);
pipe.Invoke();
导致以下错误
术语“ connect-QADService”不被视为cmdlet,函数,脚本文件或可运行程序的名称。 检查名称的拼写,或者是否包含路径,请验证路径是否正确,然后重试。
安装ActiveRoles cmdlet并成功在Power Shell中运行等效命令后。 我会在项目引用中错过一些dll吗? 谢谢
默认情况下,Quest ActiveRoles cmdlet不会加载到PowerShell会话中,因为它们不是PowerShell的一部分。
PowerShell 3将在需要时自动加载模块。 我不知道在使用RunSpace时是否适用,因为我从未以这种方式使用过PowerShell。
您是否在PowerShell配置文件中加载Quest管理单元或模块? 您需要在C#代码中执行等效操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.