<?xml version="1.0" encoding="utf-8"?>

<helpItems xmlns="http://msh" 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">
<_locDefinition xmlns="urn:locstudio">
    <_locDefault _loc="locNone" />
    <_locTag _loc="locData">maml:description</_locTag>
    <_locTag _loc="locData">maml:introduction</_locTag>
    <_locTag _loc="locData">maml:para</_locTag>
    <_locTag _loc="locData">Introduction</_locTag>
    <_locTag _loc="locData">Description</_locTag>
    <_locTag _loc="locData">DetailedDescription</_locTag>
    <_locTag _loc="locData">Synopsis</_locTag>
    <_locTag _loc="locData">Title</_locTag>
    <_locTag _loc="locData">Notes</_locTag>
</_locDefinition>
<!--Generated by Help Cmdlet Editor-->
	<command:details>
		<command:name>Convert-UrnToPath</command:name>
		<maml:description>
			<maml:para>Converts a SQL Server Management Object URN to a SQL Server PowerShell provider path.</maml:para>
		</maml:description>
		<maml:copyright>
           <maml:para />
		<!--Add copy right info here.-->
		</maml:copyright>
		<command:verb>Convert</command:verb>
		<command:noun>UrnToPath</command:noun>
		<!--Add Dev version info here.-->
		<dev:version />
	</command:details>
	<maml:description>
	<!--This is the Description section-->
		<maml:para>Converts a SQL Server Management Object Uniform Resource Name (URN) to a SQL Server provider path. SQL Server Management Objects have a Urn property that returns a string indicating their location in the SQL Server object hierarchy.
If nodes in the Urn are SQL Server delimited identifiers that have extended characters not supported in PowerShell path nodes, the extended characters are encoded with their hexadecimal representation. For example, a table name &quot;My:Table&quot; is encoded as &quot;My%3ATable&quot;.</maml:para>
	</maml:description>
	<command:syntax>		<command:syntaxItem>
			<maml:name>Convert-UrnToPath</maml:name>
			<command:parameter required = "true" variableLength = "false" globbing = "false" pipelineInput = "true (ByValue, ByPropertyName)" position = "2" >
				<maml:name>Urn</maml:name>
				<maml:description>
					<maml:para>A character string containing a SQL Server Unique Resource Name (URN). A SQL Server URN is a string that identifies the location of an object in the SQL Server hierarchy. URNs have the same information as a SQL Server PowerShell path, only in a different format. SQL Server Management Objects have a Urn property.</maml:para>
				</maml:description>
			<command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
			</command:parameter>
		</command:syntaxItem>
	</command:syntax>
	<command:parameters>
		<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2">
			<maml:name>Urn</maml:name>
			<maml:description>
				<maml:para>A character string containing a SQL Server Unique Resource Name (URN). A SQL Server URN is a string that identifies the location of an object in the SQL Server hierarchy. URNs have the same information as a SQL Server PowerShell path, only in a different format. SQL Server Management Objects have a Urn property.</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:parameters>
	<command:inputTypes>
		<command:inputType>
			<dev:type>
				<maml:name>String</maml:name>
				<maml:uri/>
				<maml:description>
					<maml:para>A character string containing a SQL Server Management Object URN.</maml:para>
				</maml:description>
			</dev:type>
			<maml:description></maml:description>
		</command:inputType>
	</command:inputTypes>
	<command:returnValues>
		<command:returnValue>
			<dev:type>
				<maml:name>String</maml:name>
				<maml:uri />
				<maml:description>
					<maml:para>A character string containing a SQL Server PowerShell provider path.</maml:para>
				</maml:description>
			</dev:type>
			<maml:description></maml:description>
		</command:returnValue>
	</command:returnValues>
	<command:terminatingErrors>
	</command:terminatingErrors>
	<command:nonTerminatingErrors>
	</command:nonTerminatingErrors>
	<maml:alertSet>
		<maml:title></maml:title>
		<maml:alert>
			<maml:para></maml:para>
		</maml:alert>
	</maml:alertSet>
	<command:examples>
		<command:example>
			<maml:title>
--------------  Example 1 --------------			</maml:title>
			<maml:introduction>
				<maml:para>C:\PS&gt;</maml:para>
C:\PS&gt;			</maml:introduction>
  			<dev:code>Set-Location SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks
Convert-UrnToPath -Urn (Get-Item .).Urn.ToString()</dev:code>
  			<dev:remarks>
				<maml:para>Returns a character string containing the current path. The example uses the ToString() function of the SMO Urn property to return the Urn as a character string.</maml:para>
				<maml:para></maml:para>
				<maml:para></maml:para>
				<maml:para>SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks
				</maml:para>
				<maml:para></maml:para>
  			</dev:remarks>
			<command:commandLines>
				<command:commandLine>
					<command:commandText>
					</command:commandText>
				</command:commandLine>
			</command:commandLines>
		</command:example>
		<command:example>
			<maml:title>
--------------  Example 2 --------------			</maml:title>
			<maml:introduction>
				<maml:para>C:\PS&gt;</maml:para>
C:\PS&gt;			</maml:introduction>
  			<dev:code>Set-Location ( Convert-UrnToPath -Urn &quot;Server[@Name='MyComputer']/Database[@Name='AdventureWorks']/Table[@Name='Address' and @Schema = 'Person']&quot; )</dev:code>
  			<dev:remarks>
				<maml:para>Sets the path to the location specified in a SQL Server Management Object URN.</maml:para>
				<maml:para></maml:para>
				<maml:para></maml:para>
				<maml:para>
				</maml:para>
				<maml:para></maml:para>
  			</dev:remarks>
			<command:commandLines>
				<command:commandLine>
					<command:commandText>
					</command:commandText>
				</command:commandLine>
			</command:commandLines>
		</command:example>
		<command:example>
			<maml:title>
--------------  Example 3 --------------			</maml:title>
			<maml:introduction>
				<maml:para>C:\PS&gt;</maml:para>
C:\PS&gt;			</maml:introduction>
  			<dev:code>Set-Location SQLSERVER:\SQL\MyComputer\DEFAULT\Databases
foreach ($Item in Get-ChildItem) { $Item.Urn.ToString() | Convert-UrnToPath }</dev:code>
  			<dev:remarks>
				<maml:para>Returns a set of character strings, each containing the path to a database in the default instance. Uses a pipeline to pass the current node URN to Convert-UrnToPath</maml:para>
				<maml:para></maml:para>
				<maml:para></maml:para>
				<maml:para>SQLSERVER:\SQL\MyComputer\DEFAULT\Databases\AdventureWorks
				</maml:para>
				<maml:para></maml:para>
  			</dev:remarks>
			<command:commandLines>
				<command:commandLine>
					<command:commandText>
					</command:commandText>
				</command:commandLine>
			</command:commandLines>
		</command:example>
	</command:examples>
	<maml:relatedLinks>
		<maml:navigationLink>
			<maml:linkText>Decode-SqlName</maml:linkText>
			<maml:uri/>
		</maml:navigationLink>
		<maml:navigationLink>
			<maml:linkText>Encode-SqlName</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">
<!--Generated by Help Cmdlet Editor-->
	<command:details>
		<command:name>Decode-SqlName</command:name>
		<maml:description>
			<maml:para>Returns the original SQL Server identifier when given an identifier that has been encoded into a format usable in PowerShell paths.</maml:para>
		</maml:description>
		<maml:copyright>
           <maml:para />
		<!--Add copy right info here.-->
		</maml:copyright>
		<command:verb>Decode</command:verb>
		<command:noun>SqlName</command:noun>
		<!--Add Dev version info here.-->
		<dev:version />
	</command:details>
	<maml:description>
	<!--This is the Description section-->
		<maml:para>Returns the un-encoded SQL Server identifier when given an identifier that has been encoded into a format usable in PowerShell paths. SQL Server delimited identifiers can contain special characters not normally supported in PowerShell object names. These extended characters must be either encoded to their hexadecimal representation or escaped using the ` character. Certain characters, such as the colon character (:) cannot be escaped. The hexadecimal encoding is in the format %nn. Decode-SqlName converts the following encodings to the corresponding characters:
%5C-\    %3A-:    %2F-/   %25-%    %3C-&lt;    %3E-&gt;
%2A-*    %3F-?    %5B-[    %5D-]    %7C-|</maml:para>
	</maml:description>
	<command:syntax>		<command:syntaxItem>
			<maml:name>Decode-SqlName</maml:name>
			<command:parameter required = "true" variableLength = "false" globbing = "false" pipelineInput = "true (ByValue, ByPropertyName)" position = "2" >
				<maml:name>SqlName</maml:name>
				<maml:description>
					<maml:para>The SQL Server identifier to be reformatted.</maml:para>
				</maml:description>
			<command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
			</command:parameter>
		</command:syntaxItem>
	</command:syntax>
	<command:parameters>
		<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2">
			<maml:name>SqlName</maml:name>
			<maml:description>
				<maml:para>The SQL Server identifier to be reformatted.</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:parameters>
	<command:inputTypes>
		<command:inputType>
			<dev:type>
				<maml:name>String</maml:name>
				<maml:uri/>
				<maml:description>
					<maml:para>A character string containing a SQL Server identifier.</maml:para>
				</maml:description>
			</dev:type>
			<maml:description></maml:description>
		</command:inputType>
	</command:inputTypes>
	<command:returnValues>
		<command:returnValue>
			<dev:type>
				<maml:name>String</maml:name>
				<maml:uri />
				<maml:description>
					<maml:para>A character string in which any escaped or encoded characters are returned to their original values.</maml:para>
				</maml:description>
			</dev:type>
			<maml:description></maml:description>
		</command:returnValue>
	</command:returnValues>
	<command:terminatingErrors>
	</command:terminatingErrors>
	<command:nonTerminatingErrors>
	</command:nonTerminatingErrors>
	<maml:alertSet>
		<maml:title></maml:title>
		<maml:alert>
			<maml:para></maml:para>
		</maml:alert>
	</maml:alertSet>
	<command:examples>
		<command:example>
			<maml:title>
--------------  Example 1 --------------			</maml:title>
			<maml:introduction>
				<maml:para>C:\PS&gt;</maml:para>
C:\PS&gt;			</maml:introduction>
  			<dev:code>Decode-SqlName -SqlName &quot;My%3ATable`/&quot;</dev:code>
  			<dev:remarks>
				<maml:para>Decodes a SQL Server identifier that has an encoded hexadecimal representation for the : character. PowerShell also removes the escaping back-tick character (`) from an escaped / character.</maml:para>
				<maml:para></maml:para>
				<maml:para></maml:para>
				<maml:para>My:Table/
				</maml:para>
				<maml:para></maml:para>
  			</dev:remarks>
			<command:commandLines>
				<command:commandLine>
					<command:commandText>
					</command:commandText>
				</command:commandLine>
			</command:commandLines>
		</command:example>
	</command:examples>
	<maml:relatedLinks>
		<maml:navigationLink>
			<maml:linkText>SQL Server Books Online: Using SQL Server Identifiers in PowerShell</maml:linkText>
			<maml:uri/>
		</maml:navigationLink>
		<maml:navigationLink>
			<maml:linkText>SQLServer Provider</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">
<!--Generated by Help Cmdlet Editor-->
	<command:details>
		<command:name>Encode-SqlName</command:name>
		<maml:description>
			<maml:para>Encodes extended characters in SQL Server names to formats usable in PowerShell paths.</maml:para>
		</maml:description>
		<maml:copyright>
           <maml:para />
		<!--Add copy right info here.-->
		</maml:copyright>
		<command:verb>Encode</command:verb>
		<command:noun>SqlName</command:noun>
		<!--Add Dev version info here.-->
		<dev:version />
	</command:details>
	<maml:description>
	<!--This is the Description section-->
		<maml:para>Encodes special characters in SQL Server names to formats usable in PowerShell paths. SQL Server delimited identifiers can contain characters not normally supported in PowerShell object names. When using delimited identifiers in SQL Server provider paths, these extended characters must be either encoded to their hexadecimal representation or escaped using the ` character. Certain characters, such as the colon character (:) cannot be escaped. The hexadecimal encoding for the characters is in the format %nn. The characters encoded by Encode-SqlName are: \:/%&lt;&gt;*?[]|</maml:para>
	</maml:description>
	<command:syntax>		<command:syntaxItem>
			<maml:name>Encode-SqlName</maml:name>
			<command:parameter required = "true" variableLength = "false" globbing = "false" pipelineInput = "true (ByValue, ByPropertyName)" position = "2" >
				<maml:name>SqlName</maml:name>
				<maml:description>
					<maml:para>The SQL Server identifier to be encoded.</maml:para>
				</maml:description>
			<command:parameterValue required="true" variableLength = "false" >String</command:parameterValue>
			</command:parameter>
		</command:syntaxItem>
	</command:syntax>
	<command:parameters>
		<command:parameter required="true" variableLength="false" globbing="false" pipelineInput="true (ByValue, ByPropertyName)" position="2">
			<maml:name>SqlName</maml:name>
			<maml:description>
				<maml:para>The SQL Server identifier to be encoded.</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:parameters>
	<command:inputTypes>
		<command:inputType>
			<dev:type>
				<maml:name>String</maml:name>
				<maml:uri/>
				<maml:description>
					<maml:para>A character string containing the SQL Server identifier (object name) to be encoded.</maml:para>
				</maml:description>
			</dev:type>
			<maml:description></maml:description>
		</command:inputType>
	</command:inputTypes>
	<command:returnValues>
		<command:returnValue>
			<dev:type>
				<maml:name>String</maml:name>
				<maml:uri />
				<maml:description>
					<maml:para>The encoded identifier.</maml:para>
				</maml:description>
			</dev:type>
			<maml:description></maml:description>
		</command:returnValue>
	</command:returnValues>
	<command:terminatingErrors>
	</command:terminatingErrors>
	<command:nonTerminatingErrors>
	</command:nonTerminatingErrors>
	<maml:alertSet>
		<maml:title></maml:title>
		<maml:alert>
			<maml:para></maml:para>
		</maml:alert>
	</maml:alertSet>
	<command:examples>
		<command:example>
			<maml:title>
--------------  Example 1 --------------			</maml:title>
			<maml:introduction>
				<maml:para>C:\PS&gt;</maml:para>
C:\PS&gt;			</maml:introduction>
  			<dev:code>Encode-SqlName -SqlName &quot;My:Table/&quot;</dev:code>
  			<dev:remarks>
				<maml:para>Encodes a SQL Server table name that contains : and / characters.</maml:para>
				<maml:para></maml:para>
				<maml:para></maml:para>
				<maml:para>My%3ATable%2F
				</maml:para>
				<maml:para></maml:para>
  			</dev:remarks>
			<command:commandLines>
				<command:commandLine>
					<command:commandText>
					</command:commandText>
				</command:commandLine>
			</command:commandLines>
		</command:example>
	</command:examples>
	<maml:relatedLinks>
		<maml:navigationLink>
			<maml:linkText>SQL Server Books Online: Using SQL Server Identifiers in PowerShell</maml:linkText>
			<maml:uri/>
		</maml:navigationLink>
		<maml:navigationLink>
			<maml:linkText>SQLServer Provider</maml:linkText>
			<maml:uri/>
		</maml:navigationLink>
	</maml:relatedLinks>
</command:command>
<providerHelp>

<Name>
	SQLServer
</Name>

<Drives>
	<Para>SQLSERVER, SQL, SQLPolicy, SQLRegistration</Para>
</Drives>
<Synopsis>
	Access SQL Server instances and their databases.
</Synopsis>

<DetailedDescription>
	<para>The Microsoft SQL Server PowerShell provider lets you manage the configuration of instances of the SQL Server Database Engine and the objects in those instances. The SQL Server PowerShell provider implements separate path hierarchies for different classes of objects that are supported by the SQL Server management object models.

The SQL Server PowerShell provider implements one virtual drive named SQLSERVER: to work with specific parts of SQL Server. The SQLSERVER: drive has four initial folders: \SQL, \SQLPolicy, \SQLRegistration, and \DataCollection.

The SQLSERVER:\SQL folder lets you navigate to instances of the SQL Server Database Engine and manage the objects in the instances, such as logins, tables, functions, jobs, queues, and mail agents. The SQL folder operates using the objects in these namespaces:

  Microsoft.SqlServer.Management.SMO
  Microsoft.SqlServer.Management.SMO.Agent
  Microsoft.SqlServer.Management.SMO.Broker
  Microsoft.SqlServer.Management.SMO.Mail

The SQLSERVER:\SQLPolicy folder lets you navigate to instances of the Database Engine and manage Policy-Based Management objects such as policies and facets. The SQLPolicy folder operates using the objects in the Microsoft.SqlServer.Management.Dmf and Microsoft.SqlServer.Management.Facets namespaces.

The SQLSERVER:\SQLRegistration folder lets you navigate to instances of the Database Engine and manage Registered Server objects such as server groups and registered servers. The SQLRegistration folder operates using the objects in the Microsoft.SqlServer.Management.RegisteredServers and Microsoft.SqlServer.Management.RegSvrEnum namespace.

The SQLSERVER:\DataCollection folder lets you navigate to instances of the Database Engine and manage Data Collector objects such as collection sets and configuration stores. The DataCollection folder operates using the objects in the Microsoft.SqlServer.Management.Collector namespace.

You can navigate the SQLSERVER: paths by using PowerShell path cmdlets such as Get-Location, Set-Location, and Get-ChildItem.

The leading part of a SQLSERVER:\SQL path has the form SQLSERVER:\SQL\ComputerName\InstanceName. You must always specify an instance name, even for default instances. Specify DEFAULT for default instance names. The path nodes following the InstanceName alternate between object classes and object names. Schemas are not represented as an object class. When you specify a path node for top level objects in schemas, such as tables or views, the node name must be in the format SchemaName.ObjectName. For example, this is the path to the AddressID column in the Address table of the Person schema:

SQLSERVER:\SQL\MyComputer\DEFAULT\Databases\AdventureWorks\Tables\Person.Address\Columns\AddressID

To save typing, you can create your own PowerShell drives that map over the first several nodes of an SQL path.

The information that is returned by Get-ChildItem depends on which part of the path the cmdlet is executed from:

Returns the local computer name and the list of computers to which you have opened Database Engine connections by using WMI:
PS SQLSERVER:\SQL\&gt; Get-ChildItem

Returns the list of instances on the specified computer:
PS SQLSERVER:\SQL\ComputerName&gt; Get-ChildItem

Returns the list of top-level object types from the instance, such as Logins and Databases:
PS SQLSERVER:\SQL\ComputerName\InstanceName&gt; Get-ChildItem.

With the SQL Server PowerShell provider, you manage the objects that are exposed in SQL Server paths by using the SQL Server management object model methods and properties for that class of object. For example, you can use the methods of the Microsoft.SQLServer.Management.SMO.Database class to perform actions such as creating, altering, and dropping databases. You can also use the class properties to query the current state of the objects. Use the Get-Member cmdlet to get a list of the methods and properties that are supported for the various objects. For information about the classes, see the namespace reference sections in the SQL Server Books Online.

You cannot select, insert, update, or delete data in tables and views by using the SQL Server PowerShell provider. For example, there is no Select() or Insert() method for tables. Use the Invoke-Sqlcmd cmdlet to access and change the data in tables and views.

The SQL Server PowerShell provider opens Windows Authentication connections by using the credentials of the Windows account that is running the PowerShell session. The PowerShell provider does not support SQL Server Authentication connections.

In complex databases, the lists returned by Get-ChildItem and the PowerShell tab-completion lists can be very large. You can use three system variables created by the SQL Server PowerShell provider to control the size of these lists:

$SqlServerMaximumTabCompletion = n
n is an integer that specifies the maximum number of objects in a tab completion list. The default is 0, which means all objects are returned.

$SqlServerMaximumChildItems = n
n is an integer that specifies the maximum number of objects returned when you run Get-ChildItem on SQL Server path nodes. The default is 0, which means all objects are returned.

$SQLServerIncludeSystemObjects = { $True | $False }
Specifies whether SQL Server system objects are returned by Get-ChildItem or included in tab-completion lists. The default is $False</para>
</DetailedDescription>

<Capabilities>
	<para></para>
</Capabilities>
<Filters>
	<para></para>
</Filters>
<Notes>
	SQL Server delimited identifiers are object names that are enclosed in brackets ([Table:Name]) or quotation marks (&quot;View&gt;Name&quot;). Delimited identifiers can contain any Unicode character. The special characters in these names must be either encoded to their hexadecimal representation or escaped for use in PowerShell paths. The hexadecimal encoding for characters uses the format %nn. An example of encoding the colon (:)character in the name &quot;Table:Name&quot; is:
Set-Location &quot;Table%3AName&quot;.

The PowerShell escape character is the back tick (`) character that is typically on the key at the top left of the keyboard. An example of escaping an extended character is as follows:
Set-Location &quot;View`&gt;Name&quot;

Certain characters, such as the colon character (:), cannot be escaped. They must be encoded. The SQL Server PowerShell provider snapin implements two cmdlets to help encode and decode delimited identifiers: Encode-SqlName and Decode-SqlName.

You must supply a registry or directory object for the -Type parameter when you use these core cmdlets with a SQLRegistration: drive: Copy-Object, Move-Object, New-Object, Remove-Object, and Rename-Object.
</Notes>
<Tasks>
	<Task>
  		<Title>
			Navigating SQLSERVER:\SQL Paths
		</Title>

   		<Description>
			<para>Use the Set-Location cmdlet to navigate through SQLSERVER:\SQL paths.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>This example uses the Set-Location cmdlet to change the path to the SQL folder.</para>
				</Introduction> 
	  			<Code>
					Set-Location SQLSERVER:\SQL
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 2 --------------------------
				</Title>
				<Introduction>
					<para>This example uses Set-Location to change the path to a default instance of the Database Engine</para>
				</Introduction>
	  			<Code>
					Set-Location SQLSERVER:\SQL\MyComputer\DEFAULT
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 3 --------------------------
				</Title>
				<Introduction>
					<para>This example uses Set-Location to change the path to the AdventureWorks sample database.</para>
				</Introduction>
	  			<Code>
					Set-Location SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
	<Task>
  		<Title>
			Build a New PowerShell Drive
		</Title>

   		<Description>
			<para>You can save typing by creating your own PowerShell drive that maps over the first several nodes of a commonly used SQLSERVER: path.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>If you are going to do a lot of work in the AdventureWorks database, create a new AWDB: drive to save typing.</para>
				</Introduction>
	  			<Code>
					New-PSDrive -Name AWDB -Root SQLSERVER:\SQL\MyComputer\DEFAULT\Databases\AdventureWorks -PSProvider SQLServer
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
	<Task>
  		<Title>
			Get the Methods and Properties of a SQL Server Object
		</Title>

   		<Description>
			<para>For each object class it includes in paths, the SQL Server PowerShell Provider includes the methods and properties of the underlying SQL Server management object class. You can use Get-Member to find the methods and properties supported by each object class. Get-Member displays the name of the SQL Server management object class at the top of its output, for example Microsoft.SqlServer.Management.SMO.Database. For more information about the methods and properties listed by Get-Member, look up the class reference documentation in the SQL Server Books Online.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>This command lists the methods for the SMO Database class.</para>
				</Introduction>
	  			<Code>
					[Microsoft.SqlServer.Management.Smo.Database] | Get-Member -Type Methods
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 2 --------------------------
				</Title>
				<Introduction>
					<para>This command sets a variable to the SMO Database class and then gets a list of the members supported by the class.</para>
				</Introduction>
	  			<Code>
					$MyVar = New-Object Microsoft.SqlServer.Management.SMO.Database
$MyVar | Get-Member -Type Properties
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 3 --------------------------
				</Title>
				<Introduction>
					<para>This command navigates to the database node in a SQLSERVER:\SQL path and get s a list of the properties that are supported for databases.</para>
				</Introduction> 
	  			<Code>
					Set-Location SQLSERVER:\SQL\MyComputer\DEFAULT\Databases
Get-Item . | Get-Member -Type Properties
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
	<Task>
  		<Title>
			Filter SQL Server Objects by Using SMO Properties
		</Title>

   		<Description>
			<para>You can use the SQL Server management object properties in WHERE commands to filter the list of items.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>This command lists only the tables that are in the AdventureWorks Sales schema.</para>
				</Introduction>
	  			<Code>
					Set-Location SQLSERVER:\SQL\MyComputer\DEFAULT\Databases\AdventureWorks\Tables
Get-ChildItem | WHERE {$_.Schema -eq &quot;Sales&quot;}
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
	<Task>
  		<Title>
			Generate Scripts That Create SQL Server Objects
		</Title>

   		<Description>
			<para>Using the SMO Script method, you can use PowerShell to generate a Transact-SQL script that recreates all of a given class of objects. The script can then be run using either the Run-Sqlcmd cmdlet or the sqlcmd.exe utility, such as when deploying a database to a new system.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>This script creates a Views.sql file that contains the CREATE VIEW statements that are required to recreate all of the views that are defined in AdventureWorks.</para>
				</Introduction>
	  			<Code>
					Remove_Item c:\PowerShell\Views.sql
Set-Location SQLSERVER:\SQL\MyComputer\DEFAULT\Databases\AdventureWorks\Views
foreach ($Item in Get-ChildItem) {$Item.Script() | Out-File -Filepath c:\PowerShell\Views.sql -append }
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
	<Task>
  		<Title>
			Use SMO to Manage SQL Server Objects
		</Title>

   		<Description>
			<para>You can use the SQL Server Management Objects (SMO) methods to create, alter, drop, and configure SQL Server objects. You can also use the SMO properties to query the state of SQL Server objects.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>This script uses SMO to create a database and then query its state.</para>
				</Introduction>
	  			<Code>
					Set-Location SQLSERVER:\SQL\MyComputer\DEFAULT\Databases
$MyVar = New-Object Microsoft.SqlServer.Management.SMO.Database
$MyVar.Parent = (Get-Item ..)
$MyVar.Name = &quot;NewDB&quot;
$MyVar.Create()
$MyVar.State
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
	<Task>
  		<Title>
			Controlling SQL Server Objects in Tab-completion and Get-ChildItem
		</Title>

   		<Description>
			<para>You can set system variables to limit the number of SQL Server objects included in tab-completion lists or returned by Get-ChildItem.</para>		
		</Description>

		<Examples>
                        <Example>
                        	<Title>
					-------------------------- EXAMPLE 1 --------------------------
				</Title>
				<Introduction>
					<para>This script sets the values for the system variables that control the number of SQL Server objects included in tab-completion lists or returned by Get-ChildItem.</para>
				</Introduction>
	  			<Code>
					$SqlServerMaximumTabCompletion = 20
$SqlServerMaximumChildItems = 10
$SqlServerIncludeSystemObjects = $False
dir variable:sqlserver*
				</Code>
				<Remarks>
					<para></para>
	  			</Remarks>
			</Example>
		</Examples>
	</Task>
</Tasks>
<DynamicParameters>
	<DynamicParameter>
		<Name></Name>

		<CmdletSupported></CmdletSupported>

		<Type>
            		<Name></Name>
      		</Type>

      		<Description></Description>

		<PossibleValues>
			<PossibleValue>
				<Value></Value>

				<Description>
					<para></para>
				</Description>

			</PossibleValue>
		</PossibleValues>
	</DynamicParameter>
</DynamicParameters>
<RelatedLinks>
	about_provider
	Encode-SqlName
	Decode-SqlName
	Run-Sqlcmd
	New-PSDrive
	Get-Member
</RelatedLinks>

</providerHelp>

</helpItems>
