powershellscripts.com

Tutorials  PowerShell Cmdlet Help for Decode-SqlName



NAME
Decode-SqlName

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

SYNTAX
Decode-SqlName [-SqlName] []


DESCRIPTION
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 PowerS
hell 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 encod
ing is in the format %nn. Decode-SqlName converts the following encodings to the corresponding characters:
%5C-\ %3A-: %2F-/ %25-% %3C-< %3E->
%2A-* %3F-? %5B-[ %5D-] %7C-|


PARAMETERS
-SqlName
The SQL Server identifier to be reformatted.

Required? true
Position? 2
Default value
Accept pipeline input? true (ByValue, ByPropertyName)
Accept wildcard characters? false


This cmdlet supports the common parameters: Verbose, Debug,
ErrorAction, ErrorVariable, WarningAction, WarningVariable,
OutBuffer and OutVariable. For more information, type,
"get-help about_commonparameters".

INPUTS
String


OUTPUTS
String


NOTES




-------------- Example 1 --------------

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


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.


My:Table/



RELATED LINKS
SQL Server Books Online: Using SQL Server Identifiers in PowerShell
SQLServer Provider