Ejemplo n.º 1
0
        internal static PowerShell GetPowerShell(object data)
        {
            PSObject psObject = PSObject.AsPSObject(data);

            if (psObject == null)
            {
                throw new PSRemotingDataStructureException(RemotingErrorIdStrings.CantCastRemotingDataToPSObject, new object[] { data.GetType().FullName });
            }
            return(PowerShell.FromPSObjectForRemoting(GetPropertyValue <PSObject>(psObject, "PowerShell")));
        }