database-tools

Creating "Static" Variables

Static variables are accessible everywhere. They can be used to collect data from various scopes in one place. You can use a prefix for a variable...

read more

Do You Use "Break"?

"Break" is a special keyword that you can use to exit loops and conditions prematurely. Have a look: Do { $pwd = Read-Host 'Enter your...

read more

Deleting Error Records

In a previous tip, you learned that "Continue" can skip code in a loop. Another scenario for using "Continue" is error handling....

read more

Using ‘Continue’

You will find that "Continue" is a special instruction that you can use in loops to skip the remainder of a loop. This next loop returns...

read more

Move Groups Of Tables

I've just started to use the Schema Designer feature, and whilst handy it is driving me mad as I can't see any way of moving a group of...

read more

Write-Output is Picky

Assigning (multiple) return values with Write-Output works well, but you should keep in mind that Write-Output is picky and returns the exact thing...

read more

Do You Know Write-Output?

When you leave data behind, PowerShell automatically returns it to the caller. This may create strange-looking code. With Write-Output, you can...

read more

Opening Event Log GUI

In a previous tip, you learned how to register event log sources and write your own event log entries. With Show-Eventlog, you can easily open the...

read more

Creating New Event Logs

Logging information to your event log is easy when using Write-Eventlog. You will just need to register your own event source first by using...

read more

Prompting for Passwords

If you need to prompt for a secret password and do not want it to be visible while entered, you should use Get-Credential. This cmdlet returns a...

read more

Finding Static Methods

You will find that types can contain very useful methods. To get a list, you can pass the type to Get-Member, but do not forget to specify the...

read more