Download the F # assembly in Powershell and create an entry

I have a Powershellscript. I have successfully downloaded the assembly C#and use of the method contained in one of the classes in this build: [MyCSharpAssembly.MyClass]::MyAssemblyMethod(). However, the same does not work for F#.

Is it possible?

I have an assembly called Data.dlland it has a module with a name People.fsand People.fsdefines the types of records:

module People =  
    type Teacher = {
        FirstName:string,
        LastName:string,
        Age:int }

I want to load the assembly Data.dllinto my Powershellscript and then create an expression of a Teacher type inside the script to use it in some other calculations in this script.

How to do it, if it can be done?

+4
source share
1 answer

F # , New-Object, .

New-Object Teacher("Jane", "Doe", 27)

Teacher.

+5

Source: https://habr.com/ru/post/1610450/


All Articles