2011-08-09 19 views

cevap

8

:

$p = new-object System.Diagnostics.Process 
$p | Add-member -Name thisisreadonly -membertype scriptproperty -value { 6} 
$p.thisisreadonly #gives 6 
$p.thisisreadonly = 5 #error- Set accessor for property "thisisreadonly" is unavailable. 

Yani temelde bir gaz giderici ama hiçbir belirleyici ile, bir ScriptProperty oluşturun.

+3

Bu eklenti üyesinin -secondvalue parametresi "pasör" sağlamak için kullanılır belirtmekte yarar var. –

+0

Ayrıca '-MemberType', 'ScriptProperty' ** değil ** '-ScriptMethod', bu yanıtın en az bir skimmer bir kaç dakika için kayıp bir gözetleme olduğunu değmez. – ruffin