代码之家  ›  专栏  ›  技术社区  ›  spoulson

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

  •  44
  • spoulson  · 技术社区  · 17 年前

    PowerShell 我正在尝试转换一个 working VBScript script

    其中一项任务是使用远程 WMI this guide .

    但是,我需要调用的WMI方法是 GetOwner() from Win32_Process

    Cannot find an overload for "GetOwner" and the argument count: "2".

    2 回复  |  直到 11 年前
        2
  •  12
  •   bahrep Ahamed    12 年前
    $explorer = gwmi Win32_Process -computerName computerName -filter "Name='explorer.exe' and SessionID=0"   
    $explorer.GetOwner() | select user,domain
    
    推荐文章