powertips

Finding AD Accounts Easily

All PowerShell versions You do not necessarily need additional cmdlets to search for user accounts or computers in your Active Directory. Provided...

read more

Creating Great Reports

All PowerShell versions You can change all properties of objects when you clone them. Cloning objects can be done to “detach” the object...

read more

Accepting Multiple Input

All PowerShell versions When you create PowerShell functions, here is a template that defines a InputObject parameter that will accept multiple...

read more

Using Default Parameters

In PowerShell 3.0, an option was added to define default values for arbitrary cmdlet parameters. This line, for example, would set the default value...

read more

Finding Working Days

To find all working days in a given month, here is a neat little one-liner: $month = 7 1..31 | ForEach-Object { Get-Date -Day $_ -Month $month } |...

read more

Speeding Up Background Jobs

Background jobs can be a great thing to speed up scripts because they can do things in parallel. However, background jobs only work well if the code...

read more

Using Nested Hash Tables

Nested hash tables can be a great alternative to multidimensional arrays. They can be used to store data sets in an easy-to-manage way. Have a look:...

read more

Speeding Up Arrays

When you assign new items to an array often, you may experience a performance problem. Here is a sample that illustrates how you should not do it:...

read more

Fun with Path Names

You can use the -split operator to easily split a path in its components. The result is always an array. Simply use comparison operators to exclude...

read more

Using Profile Scripts

You probably know that PowerShell supports profile scripts. Simply make sure the file found in $profile exists. It's a plain script that gets...

read more
1 65 66 67 68 69 122