Decode-SqlName

Returns the original SQL Server identifier when given an identifier that has been encoded into a format usable inPowerShell paths.
Decode-SqlName [-SqlName*] <string> [<CommonParameters>]

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-: %2E-. %2F-/ %25-% %3C- %2A-* %3F-? %5B-[ %5D-] %7C-|

Parameters
-SqlName <string>

  • This value is required
  • Accepts pipeline input ByValue

The SQL Server identifier to be reformatted.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Inputs

String

Outputs

String

Examples
  1. Decodes a SQL Server identifier that has an encoded hexadecimal representation for the : character:
    C:PS> Decode-SqlName -SqlName "My%3ATable`/"
    
       My:Table/

    PowerShell also removes the escaping back-tick character (`) from an escaped / character.

Additional Notes
 
Related Links

Encode-SqlName