How to call a method with output parameters in PowerShell?

前端 未结 2 1022
一向
一向 2021-01-03 17:56

I\'m working on a script to get started in PowerShell. I\'m trying to convert a working VBScript script that enumerates mapped network drives on a remote Windows computer.

2条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-03 18:31

    $explorer = gwmi Win32_Process -computerName computerName -filter "Name='explorer.exe' and SessionID=0"   
    $explorer.GetOwner() | select user,domain
    

提交回复
热议问题