如何从 powershell 输出中删除 属性 命名空间?

How to remove property namespace out of powershell output?

我想我可能在搜索错误的东西,因为我找不到这个问题的答案。基本上我 运行 Get-Process 和 select PowerShell 中的一些属性。我得到了我想要的信息,但是其中一个属性 MainModule 它包括 System.Diagnostics.Processmodule 命名空间,我只想要文件名。

谁能解释为什么会这样,我该如何摆脱它?我是 PowerShell 的新手,就像我说的,我找不到答案。

命令我是运行ning:

Get-Process | select id, processname, starttime, mainmodule | ft -AutoSize

输出:

  Id ProcessName       StartTime           MainModule                                 
  -- -----------       ---------           ----------                               
1788 armsvc            22/01/2016 07:36:31 System.Diagnostics.ProcessModule (armsvc.exe)

Image of the output

使用计算得到的 属性.

Get-Process | Select-Object `
  Id,
  ProcessName,
  StartTime,
  @{Name="ModuleName"; Expression={$_.MainModule.ModuleName}}