powershell - 如何在PowerShell中调用带有输出参数的方法?

标签 powershell wmi remote-registry

我正在编写一个脚本以开始使用 PowerShell .我正在尝试转换 working VBScript script枚举远程 Windows 计算机上的映射网络驱动器。

其中一项任务是使用远程 WMI读取注册表并找到 explorer.exe 的进程所有者以确定谁登录。这似乎很容易通过 this guide .

但是,我需要调用的 WMI 方法是 GetOwner() from Win32_Process ,它需要两个输出参数来存储其返回值。

如何调用带有输出参数的方法?当我尝试给它两个字符串时,出现错误:Cannot find an overload for "GetOwner" and the argument count: "2". . MSDN 页面说有两个参数,所以我不确定我做错了什么。

最佳答案

关于powershell - 如何在PowerShell中调用带有输出参数的方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/821744/

相关文章:

Python azure 模块: how to create a new deployment

powershell - 调用命令问题

c# - 可以在 Windows 中以编程方式识别设备的物理 USB 端口吗?

windows - 使用 Remote Registry Service 访问所有用户注册表

linux - REG QUERY 名称中有空格的键

powershell - 如何使用 PowerShell 进行远程注册表更改?

powershell - 使用PowerShell剥离数据

powershell - 'Scheduled Job"和 "Scheduled Task"在 Powershell 上下文中是否相同?

c# - 如何远程访问工作组计算机中远程主机的 Windows 服务?

powershell - 如何使用带有powershell的WMI列出IIS6网站的所有虚拟目录?