I have a class in C# say for example
public class MyComputer : PSObject
{
public string UserName
{
get { return userName; }
set { userN
Here is how it got working.
public class MyComputer
{
public string UserName
{
get { return userName; }
set { userName = value; }
}
private string userName;
public string DeviceName
{
get { return deviceName; }
set { deviceName = value; }
}
public string deviceName;
}
//PS C:\> $object = New-Object Namespace.ClassName
PS C:\> $object = New-Object Namespace.MyComputer
PS C:\> $object.UserName = "Shaj"
PS C:\> $object.DeviceName = "PowerShell"