private/Convert-ToMBSType.ps1
function Convert-ToMBSType { [CmdletBinding()] param ( [string] $MBSType, [psobject] $object ) begin { } process { $MBSObject = New-Object -TypeName $MBSType ($MBSObject | get-member -MemberType Properties).Name | ForEach-Object -Process { $MBSObject."$_" = $object."$_" } return $MBSObject } end { } } |