en/Microsoft.SqlServer.Management.PSProvider.dll-Help.xml
<?xml version="1.0" encoding="utf-8"?>
<helpItems schema="maml" xmlns="http://msh"> <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>Convert-UrnToPath</command:name> <command:verb>Convert</command:verb> <command:noun>UrnToPath</command:noun> <maml:description> <maml:para>Converts a SQL Server Management Object URN to a Windows PowerShell provider path.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The Convert-UrnToPath cmdlet converts a SQL Server Management Object Uniform Resource Name (URN) to a SQL Server provider path.</maml:para> <maml:para>SQL Server Management Objects have a Urn property that returns a string indicating their location in the SQL Server object hierarchy.</maml:para> <maml:para>If nodes in the Urn are SQL Server delimited identifiers with extended characters that are not supported in Windows PowerShell path nodes, the extended characters are encoded with their hexadecimal representation.</maml:para> <maml:para>For example, a table name "Main:Table" is encoded as "Main%3ATable".</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>Convert-UrnToPath</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>Urn</maml:name> <maml:description> <maml:para>Specifies a SQL Server URN that identifies the location of an object in the SQL Server hierarchy.</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:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>Urn</maml:name> <maml:description> <maml:para>Specifies a SQL Server URN that identifies the location of an object in the SQL Server hierarchy.</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>String</maml:name> </dev:type> <maml:description> <maml:para>Specifies a string that represents a SQL Server Management Object URN.</maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>String</maml:name> </dev:type> <maml:description> <maml:para>Specifies a string that represents a SQL Server PowerShell provider path.</maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>----- Example 1: Get a string containing the current path -----</maml:title> <dev:code>PS C:\> Set-Location "SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks2014" PS SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks2014> Convert-UrnToPath -Urn (Get-Item .).Urn.ToString() SQLSERVER:\SQL\MyComputer\MyInstance\Databases\AdventureWorks2014</dev:code> <dev:remarks> <maml:para>This command returns a string that contains the current path. The example uses the ToString() function of the Urn property to return the Urn as a string.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>------- Example 2: Set the path location based on a URN -------</maml:title> <dev:code>PS C:\> Set-Location (Convert-UrnToPath -Urn "Server[@Name='MyComputer']/Database[@Name='AdventureWorks']/Table[@Name='Address' and @Schema = 'Person']")</dev:code> <dev:remarks> <maml:para>This command sets the path to the location specified in a SQL Server Management Object URN.</maml:para> </dev:remarks> </command:example> <command:example> <maml:title>---------------- Example 3: Get database paths ----------------</maml:title> <dev:code>PS C:\> Set-Location "SQLSERVER:\SQL\MyComputer\DEFAULT\Databases" PS SQLSERVER:\SQL\MyComputer\DEFAULT\Databases> foreach ($Item in Get-ChildItem) { $Item.Urn.ToString() | Convert-UrnToPath } SQLSERVER:\SQL\MyComputer\DEFAULT\Databases\AdventureWorks2014</dev:code> <dev:remarks> <maml:para>This command returns an array of strings that contain the path to a database in the default instance. The pipeline operator is used to pass the current node URN to Convert-UrnToPath.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/sqlserver/convert-urntopath</maml:uri> </maml:navigationLink> </command: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>ConvertFrom-EncodedSqlName</command:name> <command:verb>ConvertFrom</command:verb> <command:noun>EncodedSqlName</command:noun> <maml:description> <maml:para>Returns the original SQL Server identifier when given an identifier that has been encoded into a format usable in Windows PowerShell paths.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The ConvertFrom-EncodedSqlName cmdlet returns the un-encoded SQL Server identifier when given an identifier that has been encoded into a format usable in Windows PowerShell paths.</maml:para> <maml:para>SQL Server delimited identifiers can contain special characters not normally supported in Windows PowerShell object names.</maml:para> <maml:para>These extended characters must be either encoded to their hexadecimal representation or escaped using the ` character.</maml:para> <maml:para>Certain characters, such as the colon character (:) cannot be escaped.</maml:para> <maml:para>The hexadecimal encoding is in the format %nn.</maml:para> <maml:para>Decode-SqlName converts the following encodings to the corresponding characters: - %5C becomes \</maml:para> <maml:para>- %3A becomes :</maml:para> <maml:para>- %2E becomes .</maml:para> <maml:para>- %2F becomes /</maml:para> <maml:para>- %25 becomes %</maml:para> <maml:para>- %3C becomes <</maml:para> <maml:para>- %3E becomes ></maml:para> <maml:para>- %2A becomes *</maml:para> <maml:para>- %3F becomes ?</maml:para> <maml:para>- %5B becomes [</maml:para> <maml:para>- %5D becomes ]</maml:para> <maml:para>- %7C becomes |</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>ConvertFrom-EncodedSqlName</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>SqlName</maml:name> <maml:description> <maml:para>Specifies the SQL Server identifier that this cmdlet reformats.</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:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>SqlName</maml:name> <maml:description> <maml:para>Specifies the SQL Server identifier that this cmdlet reformats.</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>String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1: Decode a SQL Server identifier ----------</maml:title> <dev:code>PS C:\> ConvertFrom-EncodedSqlName -SqlName "My%3ATable`/" My:Table/</dev:code> <dev:remarks> <maml:para>This command decodes a SQL Server identifier that has an encoded hexadecimal representation for the : character. Windows PowerShell also removes the escaping back-tick character (`) from an escaped / character.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/sqlserver/convertfrom-encodedsqlname</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Using SQL Server Identifiers in PowerShell</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>ConvertTo-EncodedSqlName</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command: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>ConvertTo-EncodedSqlName</command:name> <command:verb>ConvertTo</command:verb> <command:noun>EncodedSqlName</command:noun> <maml:description> <maml:para>Encodes extended characters in SQL Server names to formats usable in Windows PowerShell paths.</maml:para> </maml:description> </command:details> <maml:description> <maml:para>The ConvertTo-EncodedSqlName cmdlet encodes special characters in SQL Server names to formats usable in Windows PowerShell paths.</maml:para> <maml:para>SQL Server delimited identifiers can contain characters not normally supported in Windows PowerShell object names.</maml:para> <maml:para>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.</maml:para> <maml:para>Certain characters, such as the colon character (:) cannot be escaped.</maml:para> <maml:para>The hexadecimal encoding for the characters is in the format %nn.</maml:para> <maml:para>The characters encoded by ConvertTo-EncodedSqlName are: \ : . / % < > * ? [ ] |</maml:para> </maml:description> <command:syntax> <command:syntaxItem> <maml:name>ConvertTo-EncodedSqlName</maml:name> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>SqlName</maml:name> <maml:description> <maml:para>Specifies 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>None</dev:defaultValue> </command:parameter> </command:syntaxItem> </command:syntax> <command:parameters> <command:parameter required="true" variableLength="true" globbing="false" pipelineInput="True (ByPropertyName, ByValue)" position="1" aliases="none"> <maml:name>SqlName</maml:name> <maml:description> <maml:para>Specifies 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>None</dev:defaultValue> </command:parameter> </command:parameters> <command:inputTypes> <command:inputType> <dev:type> <maml:name>String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:inputType> </command:inputTypes> <command:returnValues> <command:returnValue> <dev:type> <maml:name>String</maml:name> </dev:type> <maml:description> <maml:para></maml:para> </maml:description> </command:returnValue> </command:returnValues> <maml:alertSet> <maml:alert> <maml:para></maml:para> </maml:alert> </maml:alertSet> <command:examples> <command:example> <maml:title>---------- Example 1: Encode a SQL Server table name ----------</maml:title> <dev:code>PS C:\> ConvertTo-EncodedSqlName -SqlName "My:Table/" My%3ATable%2F</dev:code> <dev:remarks> <maml:para>This command encodes a SQL Server table name that contains : and / characters.</maml:para> </dev:remarks> </command:example> </command:examples> <command:relatedLinks> <maml:navigationLink> <maml:linkText>Online Version:</maml:linkText> <maml:uri>https://learn.microsoft.com/powershell/module/sqlserver/convertto-encodedsqlname</maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>Using SQL Server Identifiers in PowerShell</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> <maml:navigationLink> <maml:linkText>ConvertFrom-EncodedSqlName</maml:linkText> <maml:uri></maml:uri> </maml:navigationLink> </command:relatedLinks> </command:command> </helpItems> |