I am trying to get the location of the current process on your computer using PowerShell.
Example
C:\Program Files (x86)\Mozilla Firefox
C:\Windows\sysWOW64\WindowsPowerShell\v1.0
C:\Program Files (x86)\Internet Explorer
When i run the command
$path = Get-Process | Select-Object Path
Split-Path $path
I get the following output, which I do not want. Why is he adding @ {Path = ?
@{Path=C:\Program Files (x86)\Mozilla Firefox
@{Path=C:\Windows\sysWOW64\WindowsPowerShell\v1.0
@{Path=C:\Program Files (x86)\Internet Explorer
When I run Split-Pathas follows, it gives the correct output C:\Windows\sysWOW64\WindowsPowerShell\v1.0.
$pshpath = "C:\Windows\sysWOW64\WindowsPowerShell\v1.0\powershell.exe"
Split-Path $pshpath
source
share