Path to Powershell.exe (v 2.0)

前端 未结 4 1015
故里飘歌
故里飘歌 2020-12-13 05:13

Where is the Powershell (version 2.0) located? What is the path to Powershell.exe? I have Windows Server 2008 and Powershell installed. When I look at this folder:



        
4条回答
  •  旧时难觅i
    2020-12-13 05:51

    Here is one way...

    (Get-Process powershell | select -First 1).Path
    

    Here is possibly a better way, as it returns the first hit on the path, just like if you had ran Powershell from a command prompt...

    (Get-Command powershell.exe).Definition
    

提交回复
热议问题