database-tools

Am I Privileged?

There are numerous ways to find out if a script runs elevated. Here's a pretty simple approach: PS> (whoami /all | Select-String...

read more

Checking User Privileges

whoami.exe is a useful little tool that ships with Windows 7/Server 2008 R2, and it becomes even more useful when you instruct it to output its...

read more

Resolving Paths

Paths can be relative, such as ". \file.txt". To resolve such a path and display its full path, you could use Resolve-Path: PS>...

read more

Check PowerShell Speed

To find out how much time a particular cmdlet or command takes, here's a handy little stopwatch that you can use: function Test { $codetext =...

read more

Pinning PowerShell ISE

The integrated PowerShell ISE editor has its own icon and can be pinned to the Windows 7 taskbar, just like PowerShell. Try this: Open PowerShell,...

read more

No Reboots After Updates

If you have set Windows Update to automatic mode, it takes care of detecting, downloading, and installing all necessary updates - fine. However, it...

read more

Locking Drive Content

In a previous tip we showed how you can hide drive letters in Windows Explorer. You may have discovered, though, that a user can still open files...

read more

Implicit Foreach in PSv3

PowerShell v3 Beta is available for quite some time now, so every now and then we start tossing in some PowerShell v3 tips. We'll clearly mark...

read more

Hiding Drive Letters

Sometimes you may want to hide drive letters in Windows Explorer from users. There's a Registry key that can do this for you. It takes a bit...

read more

Matching "Stars"

Asterisk serve as wildcards, so how would you check for the presence of an asterisk? It's much harder than you might think: PS>...

read more

Clearing WinEvent Logs

With Get-WinEvent you can access the various Windows log files such as this one: PS> Get-WinEvent Microsoft-Windows-WinRM/Operational There is no...

read more