Powershell

Creating Real Classes

PowerShell introduces class support in PowerShell 5.0, but you can define your own classes in other PowerShell versions as well. Simply use C# code...

read more

Executing with Timeout

Start-Process can start processes but does not support a timeout. If you wanted to kill a runaway process after a given timeout, you could use an...

read more

Finding Drive Letters

Here is a simple function to find out the reserved drive letters: #requires -Version 3 function Get-DriveLetter { (Get-WmiObject -Class...

read more

Quickly Finding Scripts

To quickly locate a PowerShell script anywhere in your MyDocuments folder, take a look at this Find-Script function: #requires -Version 3 function...

read more

Hiding Variable Content

When you override the ToString() method of an object you control how this object is displayed. The object content stays untouched, though: $a = 123...

read more

Remove Array Elements

Did you ever need to compare two arrays? Compare-Object might help. Check this out: $array1 = 1..100 $array2 = 2,4,80,98 Compare-Object...

read more
1 61 62 63 64 65 130