Powershell

Ejecting CD Drive

Here is a fun little function that uses WMI to eject your CD drive. It does so by first asking WMI for all CD drives. It then uses the explorer...

read more

Beware of Aliases

Can you spot what is wrong here? PS C:\> function r { "This never runs" } PS C:\> r function r { "This never runs" } PS C:\> When you run...

read more

Comparing Against $NULL

If you want to find out whether a variable contains $Null (nothing), always make sure you keep $null on the left side of the comparison. Most of the...

read more

Managing NTFS Permissions

While there are not many built-in cmdlets to manage NTFS permissions, there is a growing list of open source PowerShell modules adding these. One...

read more

Working with LDAP and Dates

LDAP filters are a fast and powerful way of retrieving information from Active Directory. However, LDAP filters use a very low-level date and time...

read more

Casting Data with Culture

When casting data (converting it to a different data type), PowerShell supports two approaches that can differ considerably. Here is an example:...

read more
1 44 45 46 47 48 130