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

  1. TOPIC
  2.     PsSnapins
  3.  
  4. SHORT DESCRIPTION
  5.     A Windows PowerShell snap-in is a .NET assembly that contains Windows
  6.     PowerShell providers and/or cmdlets. Windows PowerShell comes with a set
  7.     of basic snap-ins, but you can extend the power and value of the shell
  8.     by adding snap-ins that contain providers and cmdlets that you create or
  9.     obtain from others. 
  10.  
  11. LONG DESCRIPTION
  12.     Windows PowerShell is installed with a set of snap-ins that contain the
  13.     core providers and cmdlets in the shell. You can customize your shell by
  14.     adding and removing snap-ins to get the precise set of providers and
  15.     snap-ins that you need to do your job. You can even save multiple console
  16.     configurations, each with a different set of providers and snap-ins.
  17.  
  18. BUILT-IN SNAP-INS
  19.     Windows PowerShell comes with a set of Windows PowerShell snap-ins
  20.     that contain the built-in providers and cmdlets.
  21.  
  22.     Microsoft.PowerShell.Core
  23.         Contains providers cmdlets used to manage the basic features of Windows
  24.         PowerShell. Includes the FileSystem, Registry, Alias, Environment, 
  25.         Function, and Variable providers and basic cmdlets like Get-Help, 
  26.         Get-Command, and Get-History.
  27.  
  28.     Microsoft.PowerShell.Host
  29.        Contains cmdlets used by the Windows PowerShell host, such as 
  30.        Start-Transcript and Stop-Transcript.
  31.  
  32.     Microsoft.PowerShell.Management
  33.         Contains cmdlets used to manage Windows components, including 
  34.         Get-Service, and Get-Childitem.
  35.  
  36.     Microsoft.PowerShell.Security
  37.         Contains cmdlets to manage Windows PowerShell security, such as Get-Acl,
  38.         Get-AuthenticodeSignature, and ConvertTo-SecureString
  39.  
  40.     Microsoft.PowerShell.Utility
  41.         Contains the cmdlets used to manipulate objects and data, such as 
  42.         Get-Member, Write-Host, and Format-List.
  43.  
  44.  
  45. FINDING SNAP-INS
  46.     To list the Windows PowerShell snap-ins on your system, type:
  47.  
  48.     get-pssnapin
  49.  
  50.     To find the snap-in for each Windows PowerShell provider, type: 
  51.  
  52.         get-psprovider | format-list name, pssnapin
  53.  
  54.     To list the cmdlets in a Windows PowerShell snap-in, type:
  55.  
  56.         get-command -pssnapin <snapin-name>
  57.  
  58.  
  59. INSTALLING A SNAP-IN
  60.     The built-in snap-ins are registered in the system and added to the
  61.     default console when you start Windows PowerShell. However, to use
  62.     snap-ins that you create or obtain from others, you need to register
  63.     them and add the to your console.
  64.  
  65. REGISTERING A SNAP-IN
  66.     A Windows PowerShell snap-in is a program written in a .NET language
  67.     and compiled into a DLL file. To use the providers and cmdlets in a
  68.     snap-in, you must first register the snap-in (add it to the registry). 
  69.  
  70.     Most snap-ins come with an installation program (an EXE or MSI file)
  71.     that registers the DLL for you. However, if you receive a snap-in as
  72.     a DLL file, you can register it on your system. For instructions, see
  73.     the "Register the Snap-in" topic in the Windows PowerShell SDK.
  74.  
  75.     To find all registered snap-ins on your system, or to verify that a
  76.     snap-in is registered, type:
  77.  
  78.     get-pssnapin -registered
  79.  
  80.  
  81. ADD THE SNAP-IN TO THE CONSOLE
  82.     To add a registered snap-in to the current console, use the Add-PsSnapin
  83.     cmdlet. For example, to add the SQL snap-in to the console, type:
  84.  
  85.     add-pssnapin sql
  86.  
  87.     As soon as the command completes, the providers and cmdlets in the snap-in
  88.     are available in the current console. However, the current console is not
  89.     saved automatically.
  90.  
  91.  
  92. SAVING THE CONSOLE CONFIGURATION
  93.     To use the snap-in in future Windows PowerShell sessions, you must save the
  94.     configuration of the current console, which includes the snap-in. 
  95.  
  96.     To save the current console configuration to a console file (.psc1), use
  97.     Export-Console. For example, to save the current console to the 
  98.     NewConsole.psc1 file in the current directory, type:
  99.  
  100.     export-console NewConsole
  101.  
  102.  
  103. OPENING A CONSOLE WITH THE SNAP-IN
  104.     To open a console with the console configuration that includes the snapin,
  105.     when starting Windows PowerShell, use the PsConsoleFile parameter to specify
  106.     the console file that you exported. For example, the following command 
  107.     starts Windows PowerShell with the NewConsole.psc1 console file.
  108.  
  109.     powershell.exe -psconsolefile NewConsole.psc1
  110.  
  111.     The providers and cmdlets in the snapin are now available for use.
  112.  
  113.  
  114. REMOVING A SNAP-IN
  115.     To remove a Windows PowerShell snap-in from the current console, use the
  116.     Remove-PsSnapin cmdlet. For example, to remove the Windows PowerShell SQL
  117.     snap-in from the current console, type:
  118.  
  119.     remove-pssnapin sql
  120.  
  121.     This cmdlet removes the snap-in from the console. The snap-in is still
  122.     loaded, but the providers and cmdlets that it supports are no longer
  123.     available. 
  124.  
  125.  
  126.  
  127. SEE ALSO
  128.         Add-PsSnapin
  129.         Get-PsSnapin   
  130.         Remove-PsSnapin
  131.         Export-Console
  132.         About_PsProvider
  133.  
  134.