下面是我的 Iron Python 脚本,它适用于所有系统级命令(get-process 等),但我想添加 MS-Exchange 管理单元来调用交换命令。有人能帮我吗 ?
定义运行脚本(脚本):
runspace = RunspaceFactory.CreateRunspace()
runspace.Open()
pipeline = runspace.CreatePipeline()
cache = System.IO.Path.GetTempFileName()
pipeline.Commands.AddScript(script)
pipeline.Commands.Add("Out-String")
results = pipeline.Invoke()
pickled = []
for thing in results:
pickled.append(thing.ToString())
return pickled
谢谢苏珊特