Powershellの使い方を説明できる人がいますかScriptProperty
Powershell ScriptPropertyを確認するPath
チュートリアルはほとんど確認されていませんが、-property
に関する情報があります。 私はPowerShellプロセスパス経由でチェックしようとしています。
だからget-process | get-member
をチェックしていると私はMemberTypes
の多くなった:メソッド、プロパティ、NoteProperty、ScriptProperty
をしかし、私はScriptProperty
を使用する方法を見つけ出すことはできません。
しようとしている:Get-Process -Name bits| get-member -membertype scriptproperty | select-object scriptproperty Path
しかし、私はこのエラーを取得:
Select-Object : A positional parameter cannot be found that accepts argument 'Path'.
At line:1 char:65
+ Get-Process -Name bits| get-member -membertype scriptproperty | select-object sc ...
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (:) [Select-Object], ParameterBindingException
+ FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.PowerShell.Commands.SelectObjectCommand
例:(私の英語のため申し訳ありません) は、私は、プロセスのパスを確認しようとしています、メモ帳++プロセスのパスを定義してみたいですあなたがnotepad ++を使用していて、もし私がそのコマンドを使用しようとするなら、例: Get-Process -Name notepad ++ | get-member -membertype scriptproperty | - オブジェクト名-eqパスと、それは、唯一、このような出力をプロセス・パスを提供していない:
TypeName: System.Diagnostics.Process
Name MemberType Definition
---- ---------- ----------
Path ScriptProperty System.Object Path {get=$this.Mainmodule.FileName;}
は、どのように私は、プロセスのパスを取得するにはscriptpropertyコマンドを使用する必要がありますか?あなたはName
がPath
に等しいScriptProperty
を選択したい
こんにちは、私はScriptPropertyの使い方を理解して、出力を得ました。私は達成しようとしているexplanaitionでメインエリアを更新しました。私はそのようなscriptpropertyを持っていますが、私は期待している出力を得ることができません。私の期待はプロセスへの道でした。パス私はguiのようにする必要があります(Windowsタスクマネージャー>プロセス> openFileLocation) –
はい、あなたは正しいです! :)それは基本的には何のdifrenceも持っていないので、私は単純なプロパティとしてそれを使用することができます動作している?私は混乱していたので、私はscuh explanaitionを見た:ScriptProperty System.Object Path {get = $ this.Mainmodule.FileName;} –
はい、あなたは単純なプロパティとして使うことができます。 'Get-Member'プロパティを一度使用して、あるオブジェクトが公開するプロパティ/メソッドを表示し、それを省略してそれを選択することができます。 –