Powershell

Use a Lock Screen

With WPF, PowerShell can create windows in just a couple of lines of code. Here's a funny example of a transparent screen overlay. You can call...

read more

Obfuscating Credentials

How can you securely embed confidential passwords in a PowerShell script? You can't. But you can make it harder for people to discover the...

read more

Create a Folder Selector

To add a little glamour to your scripts, here are a few lines of code that display a folder selector dialog. When a user selects a folder, your...

read more

Getting Folders by Prefix

Did you know that Group-Object can easily group elements by custom criteria? Here's a line that groups folders by their first three letters:...

read more

Finding Known USB Drives

Did you know that Windows maintains a list of all USB storage devices ever hooked up to your machine? And it's simple to dump that list: $Path =...

read more

Executing Code Remotely

In a domain environment, PowerShell remoting is working almost out of the box. All you might have to do is enable Remoting on target machines...

read more

Getting WMI IntelliSense

Get-WmiObject provides no IntelliSense for WMI classes, so you either need to know the WMI class name off hand, or use the parameter -List to search...

read more

Listing "Real" Hard Drives

WMI can provide lots of information about a system, but sometimes it is just a bit too much. So when you query for logical disks, you often get back...

read more

Monitoring Log Files

Beginning in PowerShell 3.0, it is easy to monitor text-based log files in real-time. Try this: $Path = "$home\Desktop\testfile.txt"...

read more
1 79 80 81 82 83 130