Professional Documents
Culture Documents
SQL Server 2008 Tips - 2
SQL Server 2008 Tips - 2
SQL Server 2008 Tips - 2
By
The Technocrats
<set_item> ::=
NAME = new_application_role_name
| PASSWORD = 'password'
| DEFAULT_SCHEMA = schema_name
Convert-UrnToPath Converts a SQL Server Management Object Uniform Resource Name (URN) to a SQL Server
provider path. The URN indicates a management object’s location within the SQL Server object hierarchy. If the URN path
has characters not supported by PowerShell, the characters are encoded automatically.
Decode-SQLName Returns an unencoded SQL Server identifier when given an identifier that has been encoded.
Encode-SQLName Encodes special characters in SQL Server identifiers and name paths to formats that are usable in
PowerShell paths. The characters encoded by this cmdlet include \:/%<>*?[]|. If you don’t encode these characters, you
must escape them using the single quote (') character.
Invoke-PolicyEvaluation Evaluates management policies applied to SQL Server instances. By default, this command
reports compliance but does not enforce compliance. To enforce compliance, set –AdHocPolicyEvaluationMode to
Configure.
Invoke-SQLCmd Runs a Transact-SQL or XQuery script containing commands supported by the sqlcmd utility. By
default, this cmdlet doesn’t set any sqlcmd variables by default or return message output. (Many sqlcmd commands
aren’t supported.)
As the set of available cmdlets and cmdlet options change as new versions of SQL Server PowerShell are released, you can use the
following techniques to discover new cmdlets and determine how they are used: