home *** CD-ROM | disk | FTP | other *** search
/ Chip 2008 June / CHIP-2008-06.iso / software / PowerShell / PowerShell_Setup_x86.msi / product.cab / about_Object.help_EN.txt < prev    next >
Encoding:
Text File  |  2007-10-29  |  3.1 KB  |  78 lines

  1. TOPIC
  2.     Objects
  3.  
  4. SHORT DESCRIPTION
  5.     Working with objects in the Windows PowerShell 
  6.  
  7. LONG DESCRIPTION
  8.     Every action you take in PowerShell is done within the context of objects. 
  9.     As data moves from one command to the next, it moves as one or more 
  10.     identifiable objects. An object, then, is a collection of data that 
  11.     represents an item in a namespace. An object is made up of three types 
  12.     of data: the object's type, its methods, and its properties.
  13.  
  14.     The data about an object's type provides details about what kind of 
  15.     object it is. For example, an object that represents a file is a 
  16.     FileInfo object.
  17.  
  18.     An object's method is an action that you can perform on the item that 
  19.     the object represents. For instance, a FileInfo object includes a 
  20.     method that you can use to cause the file to be copied. That is, when 
  21.     you invoke the copy method of the object, the file that the object 
  22.     represents is copied.
  23.  
  24.     An object's property is information about the state of that object. For 
  25.     example, a FileInfo object includes the length property, which 
  26.     specifies the size of the file represented by the object.
  27.  
  28.     When working with objects, you can use their methods and properties in 
  29.     your commands to take specific actions and manipulate data. This is 
  30.     especially useful when you combine multiple commands into a single 
  31.     pipeline.
  32.  
  33.     When commands are combined in a pipeline, they pass information to each 
  34.     other as objects. When the first command runs, it sends one or more 
  35.     objects down the pipeline to the second command. The second command 
  36.     receives the objects from the first command, processes the objects, and 
  37.     then passes new or revised objects to the next command in the pipeline. 
  38.     This continues until all commands in the pipeline run.
  39.  
  40.     The following example demonstrates how objects are passed from one 
  41.     command to the next:
  42.  
  43.         Get-ChildItem c: | where {$_.PsIsContainer -eq $false} | 
  44.         Format-List
  45.  
  46.     The first command (Get-ChildItem c:) returns an object for each item in 
  47.     the root directory of the file system. Those objects are passed down 
  48.     the pipeline to the second command (where {$_.PsIsContainer -eq 
  49.     $false}). The second command uses the PsIsContainer property of the 
  50.     object to filter the data from the input objects so that no directories 
  51.     (containers) are returned. The command then passes the information as 
  52.     objects to the third command (Format-List), which displays the contents 
  53.     of each piped object in a list format.
  54.  
  55. SEE ALSO
  56.     For information about namespaces, enter the following command at the 
  57.     PowerShell command prompt:
  58.  
  59.         help about_namespace
  60.  
  61.     For information about methods, enter the following command:
  62.  
  63.         help about_method
  64.  
  65.     For information about the properties, enter the following command:
  66.  
  67.         help about_property
  68.  
  69.     For information about pipelines, enter the following command:
  70.  
  71.         help about_pipeline
  72.  
  73.     For information about the Get-Member Cmdlet, enter the following 
  74.     command:
  75.  
  76.         help Get-Member
  77.  
  78.