database-tools

Converting Numeric Strings

Converting a string that contains a number is trivial in PowerShell: PS C:\> [double]"77.234" 77,234 PS C:\> If the string contains...

How to monitor tempdb databases

Introduction The tempdb system database is a workspace used to hold temporary user objects, results created through queries and sorts, and other...

How to plan future capacity

Capacity planning, especially when done for Microsoft SQL Server, is not for the faint of heart. Storage and disk capacity are apparent, but to...

Using Default Parameter Values

You may have heard about PowerShell default parameter values and $PSDefaultParameterValues. When you assign a hash table to this special variable,...

Binding Parameters by Data Type

PowerShell can automatically bind values to parameters by data type matching. Here is a sample that shows what benefit this can be. Simply run this...

Deleting Environment Variables

[AllowNull() _i="0" _address="0" theme_builder_area="post_content" /][AllowEmptyString() _i="1" _address="1" theme_builder_area="post_content" /]

Setting Environment Variables

PowerShell can set environment variables only in its process set, so these changes will not persist and are not visible outside of PowerShell. To...

Appending the Clipboard

PowerShell 5 introduces cmdlets to copy text to the clipboard, and paste it back: Set-Clipboard and Get-Clipboard. Set-Clipboard also supports the...

Deleting User Profiles

Whenever a user logs on to your computer, a user profile is created, and in the previous tip we explained how PowerShell can dump a list of user...

Playing with PowerShell Remoting

If you’d like to test-drive PowerShell remoting, you need to enable it at least on the target machine (the one you’d like to visit). For...

Execution Policy Override

If PowerShell won’t let you run a script, you may have to enable script execution first, for example like this: Set-ExecutionPolicy -Scope...

Formatting Text Output

If you’d like to nicely format output text, you may want to use a PSCustomObject and output it as a formatted list like so: $infos =...

Converting User Name to SID

If you’d need to find out the SID for a user name, here is a useful chunk of code that does the job: $domain = 'MyDomain' $username =...

1 61 62 63 64 65 159