Generics in PowerShell

I need to use the SharePoint API as follows in a PowerShell script:

C # code:

var service = farm.Services.GetValue<SPWebService>(); 

How to specify generics parameter in PowerShell?

I am currently getting an exception stating that "late-line operations cannot be performed on types or methods for which ContainsGenereicParameters is true"

+4
source share
1 answer

This is not something you can easily do. You will have to resort to Reflection to do this job. See this blog post for more information.

+7
source

All Articles