The same issue as get-service where the status returns a [system.serviceprocess.servicecontrollerstatus] and not a simple string.
The simple solutions, which should to the trick for your case aswell:
#get the service
$service = get-service
#check the typename of the property
$service.status | gm
#returns: TypeName: System.ServiceProcess.ServiceControllerStatus
When you format the data for the UD-Table simply cast the value to the Typename and then to string
Thanks for taking the time to explain this it’s very much appreciated.
I spent some time earlier trying to use your recommendation but couldn’t figure out exactly where to use the casting or how to format it.
I did actually find a fix which works in a Get-Service table so assume it will also work in my Get-ADPrincipalgroupmembership table. I tried in my home lab but for some reason, that is actually returning the GroupScope as strings which is very confusing… I’ll have to wait until I get back to work to test in AD (or sneak upstairs to the office when the missus isn`t looking )
I don’t want to be “that guy” who says, “yeah its fixed now k thx bai” so here’s what I ended up with for the Get-Service table:
Awesome!
Appreciate the complete solution, people over at StackOverflow could learn a thing from you!
Fingers crossed that it works on your production dashboard aswell!