Delen via


ConvertFrom-EncodedSqlName

Returns the original SQL Server identifier when given an identifier that has been encoded into a format usable in Windows PowerShell paths.

Syntax

Default (Default)

ConvertFrom-EncodedSqlName
    [-SqlName] <String>
    [<CommonParameters>]

Description

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.

SQL Server delimited identifiers can contain special characters not normally supported in Windows 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 becomes \
  • %3A becomes :
  • %2E becomes .
  • %2F becomes /
  • %25 becomes %
  • %3C becomes <
  • %3E becomes >
  • %2A becomes *
  • %3F becomes ?
  • %5B becomes [
  • %5D becomes ]
  • %7C becomes |

Examples

Example 1: Decode a SQL Server identifier

PS C:\> ConvertFrom-EncodedSqlName -SqlName "My%3ATable`/"

My:Table/

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.

Parameters

-SqlName

Specifies the SQL Server identifier that this cmdlet reformats.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:1
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

String

Outputs

String