HelpCache/ISE.psm1-help.xml

<?xml version = "1.0" encoding = "utf-8" ?>
 
<helpItems schema="maml">
 
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"><command:details><command:name>Get-IseSnippet</command:name><maml:description><maml:para>Gets snippets that the user created.</maml:para></maml:description><maml:copyright><maml:para /></maml:copyright><command:verb>Get</command:verb><command:noun>IseSnippet</command:noun><dev:version /></command:details><maml:description><maml:para>The Get-ISESnippet cmdlet gets the PS1XML files that contain reusable text "snippets" that the user created. It works only in Windows PowerShell ISE.
</maml:para><maml:para>When you use the New-IseSnippet cmdlet to create a snippet, New-IseSnippet creates a &lt;SnippetTitle&gt;.Snippets.ps1xml file in the $home\Documents\WindowsPowerShell\Snippets directory. Get-ISESnippet gets the snippet files in the Snippets directory.
</maml:para><maml:para>Get-IseSnippet does not get built-in snippets or snippets that are imported from modules by using the Import-IseSnippet cmdlet.</maml:para><maml:para>This cmdlet is introduced in Windows PowerShell 3.0.</maml:para></maml:description><command:syntax><command:syntaxItem><maml:name>Get-IseSnippet</maml:name></command:syntaxItem></command:syntax><command:parameters></command:parameters><command:inputTypes><command:inputType><dev:type><maml:name></maml:name><maml:uri></maml:uri><maml:description><maml:para /></maml:description></dev:type><maml:description></maml:description></command:inputType></command:inputTypes><command:returnValues><command:returnValue><dev:type><maml:name>System.IO.FileInfo</maml:name><maml:uri></maml:uri><maml:description><maml:para /></maml:description></dev:type><maml:description><maml:para>Get-ISESnippet returns a file object that represents the snippet file.</maml:para></maml:description></command:returnValue></command:returnValues><command:terminatingErrors /><command:nonTerminatingErrors /><maml:alertSet><maml:title /><maml:alert><maml:para>The New-IseSnippet cmdlet stores new user-created snippets in unsigned .ps1xml files. As such, Windows PowerShell cannot add them to a session in which the execution policy is AllSigned or Restricted. In a Restricted or AllSigned session, you can create, get, and import unsigned user-created snippets, but you cannot use them in the session.</maml:para><maml:para>To use unsigned user-created snippets that the Get-IseSnippet cmdlet returns, change the execution policy, and then restart Windows PowerShell ISE.</maml:para><maml:para>For more information about Windows PowerShell execution policies, see about_Execution_Policies.</maml:para></maml:alert><maml:alert></maml:alert><maml:alert></maml:alert></maml:alertSet><command:examples><command:example><maml:title>
-------------------------- EXAMPLE 1 --------------------------
</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;Get-ISESnippet
 
</dev:code><dev:remarks><maml:para>This command gets all user-define snippets in the Snippets directory.
</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>
-------------------------- EXAMPLE 2 --------------------------
</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;Invoke-Command -Computer (Get-Content Servers.txt) {Get-ISESnippet | Copy-Item -Destination \\Server01\Share01\Snippets}
</dev:code><dev:remarks><maml:para>This command copies all of the user-created snippets from a group of remote computers to a shared Snippets directory.
</maml:para><maml:para>The command uses the Invoke-Command cmdlet to run a Get-ISESnippet command on the computers in the Servers.txt file. A pipeline operator (|) sends the snippet files to the Copy-Item cmdlet, which copies them to the directory that is specified by the Destination parameter.
</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>
-------------------------- EXAMPLE 3 --------------------------
</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;#Parse-Snippet Function
 
function Parse-Snippet
{
  $a = Get-ISESnippet
  $snippetNamespace = @{x="http://schemas.microsoft.com/PowerShell/Snippets"}
  foreach ($snippetFile in $a)
   {
     Write-Host ""
     $Title = Select-Xml -Path $snippetFile.FullName -Namespace $snippetNamespace -XPath "//x:Title" | foreach {$_.Node.InnerXML}
     $Text = Select-Xml -Path $snippetFile.FullName -Namespace $snippetNamespace -XPath "//x:Script" | foreach {$_.Node.InnerText}
     Write-Host "Title: $Title"
     Write-Host "Text: $Text"
   }
}
 
# Sample Output
 
Title: Mandatory
Text:
Param
(
  [parameter(Mandatory=True)]
  [String[]]
  $&lt;ParameterName&gt;
)
 
Title: Copyright
Text: (c) Fabrikam, Inc. 2012
</dev:code><dev:remarks><maml:para>This function uses the Get-ISESnippet and Select-Xml cmdlets to display the Title and Text of each snippet on the local computer.
</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>
-------------------------- EXAMPLE 4 --------------------------
</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;$psISE.CurrentPowerShellTab.Snippets | Format-Table DisplayTitle, Description
</dev:code><dev:remarks><maml:para>This command displays the title and description of all snippets in the session, including built-in snippets, user-defined snippets, and imported snippets.</maml:para><maml:para>The command uses the Windows PowerShell ISE object model. The $psISE variable represents the Windows PowerShell ISE host program. The CurrentPowerShellTab property of $psISE represent the current session. The Snippets property represents snippets in the current session.</maml:para><maml:para>The $psISE.CurrentPowerShellTab.Snippets command returns a Microsoft.PowerShell.Host.ISE.ISESnippet object that represents a snippet, unlike the Get-IseSnippet cmdlet, which returns a file object (System.Io.FileInfo) that represents a snippet file.</maml:para><maml:para>The command also uses the Format-Table cmdlet to display the DisplayTitle and Description properties of the snippets in a table.</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example></command:examples><maml:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText><maml:uri>http://go.microsoft.com/fwlink/p/?linkid=287355</maml:uri></maml:navigationLink><maml:navigationLink><maml:linkText>New-IseSnippet</maml:linkText><maml:uri /></maml:navigationLink><maml:navigationLink><maml:linkText>Import-IseSnippet</maml:linkText><maml:uri /></maml:navigationLink></maml:relatedLinks></command:command>
 
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"><command:details><command:name>Import-IseSnippet</command:name><maml:description><maml:para>Imports ISE snippets into the current session</maml:para></maml:description><maml:copyright><maml:para /></maml:copyright><command:verb>Import</command:verb><command:noun>IseSnippet</command:noun><dev:version /></command:details><maml:description><maml:para>The Import-IseSnippet cmdlet imports reusable text "snippets" from a module or a directory into the current session. The snippets are immediately available for use in Windows PowerShell ISE. This cmdlet works only in Windows PowerShell Integrated Scripting Environment (ISE).</maml:para><maml:para>To view and use the imported snippets, from the Windows PowerShell ISEEdit menu, click Start Snippets or press Ctrl + J. </maml:para><maml:para>Imported snippets are available only in the current session. To import the snippets into all Windows PowerShell ISE sessions, add an Import-IseSnippet command to your Windows PowerShell profile or copy the snippet files to your local snippets directory ($home\Documents\WindowsPowershell\Snippets).</maml:para><maml:para>To be imported, the snippets must be properly formatted in the snippet XML for Windows PowerShell ISE snippets and saved in Snippet.ps1xml files. To create eligible snippets, use the New-IseSnippet cmdlet. New-IseSnippet creates a &lt;SnippetTitle&gt;.Snippets.ps1xml file in the $home\Documents\WindowsPowerShell\Snippets directory. You can move or copy the snippets to the Snippets directory of a Windows PowerShell module, or to any other directory.</maml:para><maml:para>NOTE: The Get-IseSnippet cmdlet, which gets user-created snippets in the local snippets directory, does not get imported snippets.</maml:para><maml:para>This cmdlet is introduced in Windows PowerShell 3.0.</maml:para></maml:description><command:syntax><command:syntaxItem><maml:name>Import-IseSnippet</maml:name><command:parameter required="true" variableLength="false" globbing="true" pipelineInput="false" position="1" aliases=""><maml:name>Path</maml:name><maml:description><maml:para>Imports snippets from the specified file system directory. Wildcards characters are supported.</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Recurse</maml:name><maml:description><maml:para>Imports snippets from all subdirectories of the value of the Path parameter.</maml:para></maml:description></command:parameter></command:syntaxItem><command:syntaxItem><maml:name>Import-IseSnippet</maml:name><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>ListAvailable</maml:name><maml:description><maml:para>Gets snippets from modules that are installed on the computer, even if the modules are not imported into the current session. If this parameter is omitted, and the module that is specified by the Module parameter is not imported into the current session, the attempt to get the snippets from the module will fail.</maml:para><maml:para>This parameter is valid only when the Module parameter is used in the command.</maml:para></maml:description></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Recurse</maml:name><maml:description><maml:para>Imports snippets from all subdirectories of the value of the Path parameter.</maml:para></maml:description></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Module</maml:name><maml:description><maml:para>Imports snippets from the specified module into the current session. Wildcard characters are not supported.</maml:para><maml:para>This parameter imports snippets from Snippet.ps1xml files in the Snippets subdirectory in the module path, such as $home\Documents\WindowsPowerShell\Modules\&lt;ModuleName&gt;\Snippets.</maml:para><maml:para>This parameter is designed to be used by module authors in a startup script, such as a script specified in the ScriptsToProcess key of a module manifest. Snippets in a module are not automatically imported with the module, but you can use an Import-IseSnippet command to import them.</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue></command:parameter></command:syntaxItem></command:syntax><command:parameters><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>ListAvailable</maml:name><maml:description><maml:para>Gets snippets from modules that are installed on the computer, even if the modules are not imported into the current session. If this parameter is omitted, and the module that is specified by the Module parameter is not imported into the current session, the attempt to get the snippets from the module will fail.</maml:para><maml:para>This parameter is valid only when the Module parameter is used in the command.</maml:para></maml:description><command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue><dev:type><maml:name>SwitchParameter</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Module</maml:name><maml:description><maml:para>Imports snippets from the specified module into the current session. Wildcard characters are not supported.</maml:para><maml:para>This parameter imports snippets from Snippet.ps1xml files in the Snippets subdirectory in the module path, such as $home\Documents\WindowsPowerShell\Modules\&lt;ModuleName&gt;\Snippets.</maml:para><maml:para>This parameter is designed to be used by module authors in a startup script, such as a script specified in the ScriptsToProcess key of a module manifest. Snippets in a module are not automatically imported with the module, but you can use an Import-IseSnippet command to import them.</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue>None</dev:defaultValue></command:parameter><command:parameter required="true" variableLength="false" globbing="true" pipelineInput="false" position="1" aliases=""><maml:name>Path</maml:name><maml:description><maml:para>Imports snippets from the specified file system directory. Wildcards characters are supported.</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue>None</dev:defaultValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Recurse</maml:name><maml:description><maml:para>Imports snippets from all subdirectories of the value of the Path parameter.</maml:para></maml:description><command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue><dev:type><maml:name>SwitchParameter</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter></command:parameters><command:inputTypes><command:inputType><dev:type><maml:name>None</maml:name><maml:uri></maml:uri><maml:description><maml:para /></maml:description></dev:type><maml:description><maml:para>This cmdlet does not take input from the pipeline.</maml:para></maml:description></command:inputType></command:inputTypes><command:returnValues><command:returnValue><dev:type><maml:name>None</maml:name><maml:uri></maml:uri><maml:description><maml:para /></maml:description></dev:type><maml:description><maml:para>This cmdlet does not generate output.</maml:para></maml:description></command:returnValue></command:returnValues><command:terminatingErrors /><command:nonTerminatingErrors /><maml:alertSet><maml:title /><maml:alert><maml:para>You cannot use the Get-IseSnippet cmdlet to get imported snippets. Get-IseSnippet gets only snippets in the $home\Documents\WindowsPowerShell\Snippets directory.</maml:para></maml:alert><maml:alert><maml:para>Import-IseSnippet uses the Load static method of Microsoft.PowerShell.Host.ISE.ISESnippetCollection objects. You can also use the Load method of snippets in the Windows PowerShell ISE object model: $psISE.CurrentPowerShellTab.Snippets.Load()</maml:para></maml:alert><maml:alert><maml:para>The New-IseSnippet cmdlet stores new user-created snippets in unsigned .ps1xml files. As such, Windows PowerShell cannot load them into a session in which the execution policy is AllSigned or Restricted. In a Restricted or AllSigned session, you can create, get, and import unsigned user-created snippets, but you cannot use them in the session.</maml:para><maml:para>To use unsigned user-created snippets that the Import-IseSnippet cmdlet returns, change the execution policy, and then restart Windows PowerShell ISE.</maml:para><maml:para>For more information about Windows PowerShell execution policies, see about_Execution_Policies.</maml:para></maml:alert></maml:alertSet><command:examples><command:example><maml:title>Example 1: Import snippets from a directory</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;Import-IseSnippet -Path \\Server01\Public\Snippets -Recurse
 
</dev:code><dev:remarks><maml:para>This command imports the snippets from the \\Server01\Public\Snippets directory into the current session. It uses the Recurse parameter to get snippets from all subdirectories of the Snippets directory.</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>Example 2: Import snippets from a module</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;Import-IseSnippet -Module SnippetModule -ListAvailable
 
</dev:code><dev:remarks><maml:para>This command imports the snippets from the SnippetModule module. The command uses the ListAvailable parameter to import the snippets even if the SnippetModule module is not imported into the user's session when the command runs.</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>Example 3: Find snippets in modules</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;($env:PSModulePath).split(";") | foreach {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | foreach {$_.fullname}
</dev:code><dev:remarks><maml:para>This command gets snippets in all installed modules in the PSModulePath environment variable.</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>Example 4: Import all module snippets</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;($env:PSModulePath).split(";") | foreach {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | foreach {$psise.CurrentPowerShellTab.Snippets.Load($_)}
</dev:code><dev:remarks><maml:para>This command imports all snippets from all installed modules into the current session. Typically, you don't need to run a command like this because modules that have snippets will use the Import-IseSnippet cmdlet to import them for you when the module is imported.</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>Example 5: Copy all module snippets</maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;($env:PSModulePath).split(";") | foreach {dir $_\*\Snippets\*.Snippets.ps1xml -ErrorAction SilentlyContinue} | Copy-Item -Destination $home\Documents\WindowsPowerShell\Snippets
</dev:code><dev:remarks><maml:para>This command copies the snippet files from all installed modules into the Snippets directory of the current user. Unlike imported snippets, which affect only the current session, copied snippets are available in every Windows PowerShell ISE session.</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example></command:examples><maml:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText><maml:uri>http://go.microsoft.com/fwlink/p/?linkid=287356</maml:uri></maml:navigationLink><maml:navigationLink><maml:linkText>Get-IseSnippet</maml:linkText><maml:uri /></maml:navigationLink><maml:navigationLink><maml:linkText>New-IseSnippet</maml:linkText><maml:uri /></maml:navigationLink></maml:relatedLinks></command:command>
 
<command:command xmlns:maml="http://schemas.microsoft.com/maml/2004/10" xmlns:command="http://schemas.microsoft.com/maml/dev/command/2004/10" xmlns:dev="http://schemas.microsoft.com/maml/dev/2004/10" xmlns:MSHelp="http://msdn.microsoft.com/mshelp"><command:details><command:name>New-IseSnippet</command:name><maml:description><maml:para>Creates a Windows PowerShell ISE code snippet.</maml:para></maml:description><maml:copyright><maml:para /></maml:copyright><command:verb>New</command:verb><command:noun>IseSnippet</command:noun><dev:version /></command:details><maml:description><maml:para>The New-ISESnippet cmdlet creates a reusable text "snippet" for Windows PowerShell ISE. You can use snippets to add text to the Script pane or Command pane in Windows PowerShell ISE. This cmdlet is available only in Windows PowerShell ISE.</maml:para><maml:para>Beginning in Windows PowerShell 3.0, Windows PowerShell ISE includes a collection of built-in snippets. The New-ISESnippet cmdlet lets you create your own snippets to add to the built-in collection. You can view, change, add, delete, and share snippet files and include them in Windows PowerShell modules. To see snippets in Windows PowerShell ISE, from the Edit menu, select Start Snippets or press CTRL+J.</maml:para><maml:para>The New-ISESnippet cmdlet creates a &lt;Title&gt;.Snippets.ps1xml file in the $home\Documents\WindowsPowerShell\Snippets directory with the title that you specify. To include a snippet file in a module that you are authoring, add the snippet file to a Snippets subdirectory of your module directory.</maml:para><maml:para>Note: You cannot use user-created snippets in a session in which the execution policy is AllSigned or Restricted. For more information, see the Notes section.</maml:para><maml:para>This cmdlet is introduced in Windows PowerShell 3.0.</maml:para></maml:description><command:syntax><command:syntaxItem><maml:name>New-IseSnippet</maml:name><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases=""><maml:name>Title</maml:name><maml:description><maml:para>Specifies a title or name for the snippet. The title also names the snippet file. This parameter is mandatory.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2" aliases=""><maml:name>Description</maml:name><maml:description><maml:para>Provides a description of the snippet. The description value appears when you click the snippet name in Windows PowerShell ISE. This parameter is required.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="3" aliases=""><maml:name>Text</maml:name><maml:description><maml:para>Specifies the text value that is added when you select the snippet. The snippet text appears when you click the snippet name in Windows PowerShell ISE. This parameter is mandatory.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Author</maml:name><maml:description><maml:para>Identifies the author of the snippet. The author field appears in the snippet file, but it does not appear when you click the snippet name in Windows PowerShell ISE.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>CaretOffset</maml:name><maml:description><maml:para>Places the cursor on the specified character of the snippet text. Enter an integer that represents the cursor position, with "1" representing the first character of text. The default value, 0 (zero), places the cursor immediately before the first character of text. This parameter does not indent the snippet text.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">Int32</command:parameterValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Force</maml:name><maml:description><maml:para>Overwrites snippet files with the same name in the same location. By default, New-ISESnippet does not overwrite files.
</maml:para></maml:description></command:parameter></command:syntaxItem></command:syntax><command:parameters><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Author</maml:name><maml:description><maml:para>Identifies the author of the snippet. The author field appears in the snippet file, but it does not appear when you click the snippet name in Windows PowerShell ISE.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue>None (no value)</dev:defaultValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>CaretOffset</maml:name><maml:description><maml:para>Places the cursor on the specified character of the snippet text. Enter an integer that represents the cursor position, with "1" representing the first character of text. The default value, 0 (zero), places the cursor immediately before the first character of text. This parameter does not indent the snippet text.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">Int32</command:parameterValue><dev:type><maml:name>Int32</maml:name><maml:uri /></dev:type><dev:defaultValue>0</dev:defaultValue></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="2" aliases=""><maml:name>Description</maml:name><maml:description><maml:para>Provides a description of the snippet. The description value appears when you click the snippet name in Windows PowerShell ISE. This parameter is required.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue>None</dev:defaultValue></command:parameter><command:parameter required="false" variableLength="false" globbing="false" pipelineInput="false" position="named" aliases=""><maml:name>Force</maml:name><maml:description><maml:para>Overwrites snippet files with the same name in the same location. By default, New-ISESnippet does not overwrite files.
</maml:para></maml:description><command:parameterValue required="false" variableLength="false">SwitchParameter</command:parameterValue><dev:type><maml:name>SwitchParameter</maml:name><maml:uri /></dev:type><dev:defaultValue>False</dev:defaultValue></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="3" aliases=""><maml:name>Text</maml:name><maml:description><maml:para>Specifies the text value that is added when you select the snippet. The snippet text appears when you click the snippet name in Windows PowerShell ISE. This parameter is mandatory.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue></dev:defaultValue></command:parameter><command:parameter required="true" variableLength="false" globbing="false" pipelineInput="false" position="1" aliases=""><maml:name>Title</maml:name><maml:description><maml:para>Specifies a title or name for the snippet. The title also names the snippet file. This parameter is mandatory.
</maml:para></maml:description><command:parameterValue required="true" variableLength="false">String</command:parameterValue><dev:type><maml:name>String</maml:name><maml:uri /></dev:type><dev:defaultValue>None</dev:defaultValue></command:parameter></command:parameters><command:inputTypes><command:inputType><dev:type><maml:name>None</maml:name><maml:uri></maml:uri><maml:description><maml:para /></maml:description></dev:type><maml:description><maml:para>This cmdlet does not take input from the pipeline.</maml:para></maml:description></command:inputType></command:inputTypes><command:returnValues><command:returnValue><dev:type><maml:name>None</maml:name><maml:uri></maml:uri><maml:description><maml:para /></maml:description></dev:type><maml:description><maml:para>This cmdlet does not generate any output.</maml:para></maml:description></command:returnValue></command:returnValues><command:terminatingErrors /><command:nonTerminatingErrors /><maml:alertSet><maml:title /><maml:alert><maml:para>New-IseSnippet stores new user-created snippets in unsigned .ps1xml files. As such, Windows PowerShell cannot add them to a session in which the execution policy is AllSigned or Restricted. In a Restricted or AllSigned session, you can create, get, and import unsigned user-created snippets, but you cannot use them in the session.</maml:para><maml:para>If you use the New-IseSnippet cmdlet in a Restricted or AllSigned session, the snippet is created, but an error message appears when Windows PowerShell tries to add the newly created snippet to the session. To use the new snippet (and other unsigned user-created snippets), change the execution policy, and then restart Windows PowerShell ISE.</maml:para><maml:para>For more information about Windows PowerShell execution policies, see about_Execution_Policies.</maml:para></maml:alert><maml:alert><maml:para>-- To change a snippet, edit the snippet file. You can edit snippet files in the Script pane of Windows PowerShell ISE.
 
-- To delete a snippet that you added, delete the snippet file.
 
-- You cannot delete a built-in snippet, but you can hide all built-in snippets by using the "$psise.Options.ShowDefaultSnippets=$false" command.
 
-- You can create a snippet that has the same name as a built-in snippet. Both snippets appear in the snippet menu in Windows PowerShell ISE.
</maml:para><maml:para>
</maml:para></maml:alert><maml:alert></maml:alert></maml:alertSet><command:examples><command:example><maml:title>
-------------------------- EXAMPLE 1 --------------------------
                       </maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;New-IseSnippet -Title Comment-BasedHelp -Description "A template for comment-based help." -Text "&lt;#
    .SYNOPSIS
    .DESCRIPTION
    .PARAMETER &lt;Parameter-Name&gt;
    .INPUTS
    .OUTPUTS
    .EXAMPLE
    .LINK
#&gt;"
</dev:code><dev:remarks><maml:para>This command creates a Comment-BasedHelp snippet for Windows PowerShell ISE. It creates a file named "Comment-BasedHelp.snippets.ps1xml" in the user's Snippets directory ($home\Documents\WindowsPowerShell\Snippets).
</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>
-------------------------- EXAMPLE 2 --------------------------
                       </maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;$m = @'
Param
(
  [parameter(Mandatory=$true)]
  [String[]]
  $&lt;ParameterName&gt;
)
'@
 
PS C:\&gt;New-ISESnippet -Text $m -Title Mandatory -Description "Adds a mandatory function parameter." -Author "Kim Akers, Fabrikam Corp." -Force
 
</dev:code><dev:remarks><maml:para>These commands create a Mandatory snippet for Windows PowerShell ISE. The first command saves the snippet text in the $m variable. The second command uses the New-ISESnippet cmdlet to create the snippet. The command uses the Force parameter to overwrite a previous snippet with the same name.
</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example><command:example><maml:title>
-------------------------- EXAMPLE 3 --------------------------
                       </maml:title><maml:introduction><maml:para></maml:para></maml:introduction><dev:code>PS C:\&gt;Copy-Item $home\Documents\WindowsPowerShell\Snippets\Mandatory.Snippets.ps1xml -Destination \\Server\Share
 
</dev:code><dev:remarks><maml:para>This command uses the Copy-Item cmdlet to copy the Mandatory snippet from the folder where New-ISESnippet places it to the Server\Share file share.
</maml:para><maml:para>Because the Snippets.ps1xml files that New-ISESnippet creates are text (XML) files, you can use the Item cmdlets to get, changes, move, rename, and copy them.
</maml:para></dev:remarks><command:commandLines><command:commandLine><command:commandText /></command:commandLine></command:commandLines></command:example></command:examples><maml:relatedLinks><maml:navigationLink><maml:linkText>Online Version:</maml:linkText><maml:uri>http://go.microsoft.com/fwlink/p/?linkid=287357</maml:uri></maml:navigationLink><maml:navigationLink><maml:linkText>Get-IseSnippet</maml:linkText><maml:uri /></maml:navigationLink><maml:navigationLink><maml:linkText>Import-IseSnippet</maml:linkText><maml:uri /></maml:navigationLink></maml:relatedLinks></command:command>
 
</helpItems>