次の方法で共有


Encode-SqlName

Encodes special characters in SQL Server names to characters that can be used in PowerShell paths.

構文

Default (既定)

Encode-SqlName
    -SqlName <String>

説明

The Encode-SqlName cmdlet encodes special characters in SQL Server identifier names to characters that can be used in PowerShell paths. SQL Server delimited identifiers can contain characters that are 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 cannot be escaped. The hexadecimal encoding for the characters is in the format %nn. The characters encoded by this cmdlet are: :./%<>*?[]|.

Example 1: Encode a SQL Server table name

PS C:\> Encode-SqlName -SqlName "My:Table/"
My%3ATable%2F

This command encodes a SQL Server table name that contains the colon (:) and forward-slash (/) characters.

入力

String

出力

String