Cómo encontrar las propiedades de un objeto?
¿Cómo puedo encontrar qué propiedades tiene object $a
en lo siguiente?
$a = 1
$a.length
$a | Get-Member
Get-Member no parece producir ninguna propiedad para object $a
? ¿La longitud es un property
del objeto $a
?
33
Author: Peter Mortensen, 2011-09-11
2 answers
A a es un entero, no tiene una propiedad length. Usar Get-member es la forma correcta de encontrar las propiedades de los objetos.
27
Author: Shay Levy,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-11 11:52:13
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2011-09-11 11:52:13
También puede canalizar un objeto de muestra a Select-Object para ver todas las propiedades y sus valores.
get-process | select -first 1 -prop *
14
Author: Jeffery Hicks,
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-19 18:37:17
Warning: date(): Invalid date.timezone value 'Europe/Kyiv', we selected the timezone 'UTC' for now. in /var/www/agent_stack/data/www/ajaxhispano.com/template/agent.layouts/content.php on line 61
2016-09-19 18:37:17