は、私がGet-Process
によって返さProcessStartInfo
構造を検査しようとしたが、引数フィールドにはどんな空ではありません:ProcessStartInfoの引数が空なのはなぜですか?私は実行可能ファイルのコマンドライン引数を取得しようとすると
PS C:\> ps notepad
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
272 15 3484 19888 0.39 33696 1 notepad
PS C:\> $(ps notepad).StartInfo
Verb :
Arguments :
CreateNoWindow : False
EnvironmentVariables : {ConEmuBaseDir, ConEmuConfig, ConEmuArgs, PROCESSOR_REVISION...}
Environment : {[ConEmuBaseDir, C:\Users\fluter\Tools\ConEmu.Core.17.1.18.0\Tools\ConEmu], [ConEmuConfig, ], [ConEmuArgs, ], [PROCESSOR_REVISION, 4501]...}
RedirectStandardInput : False
RedirectStandardOutput : False
RedirectStandardError : False
StandardErrorEncoding :
StandardOutputEncoding :
UseShellExecute : True
Verbs : {}
UserName :
Password :
PasswordInClearText :
Domain :
LoadUserProfile : False
FileName :
WorkingDirectory :
ErrorDialog : False
ErrorDialogParentHandle : 0
WindowStyle : Normal
しかし、Sysinternalsのではと予想、procexp
ユーティリティなどコメントが指摘したように、のWin32 WMIオブジェクトのインタフェースを使用すると、それを得ることができ、また
:スイートは、完全なコマンドラインを取得することができます。しかし、なぜこの機能がpowershellにないのですか?
[PowerShellまたはC#でプロセスのコマンドライン情報を取得する方法](https://stackoverflow.com/questions/17563411/how-to-get-command-line-info-for-a-) powershell-or-c-sharpで処理する) – LotPings
引数やstartinfoが空である理由を知っていますか? – fluter
申し訳ありません。 MicroSoftがSysinternalsを罵倒した理由があったに違いありません。タスクマネージャは成長しましたが、私はまだProcExpを使用しています。 – LotPings