Trigger a public method in a public partial class with powershell


hi together

maybe can me issue. want trigger public method in public partial class.
found solutions static methods right , not able own. hope can me.

this class , method. want trigger "public void refreshtree(spsite site)" method powershell.

namespace: mycustomer.base.layouts.base

public partial class treemaintenance : layoutspagebase
{

     public void refreshtree(spsite site)
     {
         ....
     }

}

thank advise!

greetings michael

hi michael,

as long necessary libraries valid compiled dlls , added powershell process should possible. in order use non-static method, need have object of class @ hand. maybe work you:

$treemaintenance = new-object mycustomer.base.layouts.base.treemaintenance $treemaintenance.refreshtree($site)

don't know partial classes issue though. anyway, nonstatic stuff need object use it. btw, depending on class may need use different constructor generate object. example assumes there constructor without parameters available. assumes using constructor safe.

cheers,
fred


there's no place 127.0.0.1



Windows Server  >  Windows PowerShell



Comments

Popular posts from this blog

server manager error: ADAM.events.xml could not be enumerated.

Cannot access Anywhere Access using domain name?

WMI Failure: Unable to update Local Resource Group