Using Cmdlet, (and/or PSCmdlet), I can create
[Cmdlet(VerbsCommunications.Read, "Blah", SupportsShouldProcess = true)]
public class BlahBlah : PSCmdlet
{
/// ...
}
Then, in powershell, I can then call the command
import-module .\Blah.dll -Verbose
Read-Blah
...
And everything is fine.
But I would like to create a class rather than a function so I can get an object and then use it in powershell
Something like
import-module .\Blah.dll -Verbose
$myClass = New-Object Blah
$myClass.Read
$myClass.Save -File x.txt
$myClass.BlahBlah
...
Can the above be done in C#? If so, how?