Power Tips

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Powershell Plus


13 Free SQL Tools from Idera


Free Ebook: Mastering Powershell

Archives

Welcome to the archive of tips delivered through Tobias' Tip of the Day RSS Feed and Your Power Tip of the Day email. Subscribe in the sidebar to get the latest tips!

Sort by: Most Recent | Most Viewed | Most Commented
  • Keyboard Tricks for Launching PowerShell

    If you have pinned PowerShell to your taskbar (on Windows 7: launch PowerShell, right-click its icon in the task bar, choose "Pin this program to taskbar"), then a click on the icon will open PowerShell. Here are three neat tricks: First, move...
  • 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 also automatically takes care of rebooting if required. To turn off automatic rebooting while a user is...
  • 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 and folders on hidden drives if he knows the path. So here's a very similar function. It will not hide...
  • Using PowerShell ISE with Full Privileges

    Sometimes you need full administrator privileges to debug or test a script in the ISE script editor. By default, ISE starts with restricted privileges (when Windows User Account Control (UAC) is enabled). To launch ISE with full privileges, right-click...
  • 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 them as such since they only run on PowerShell v3, not v2. This is something new in PowerShell v3: When...
  • 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 mask where each drive has a bit. When the bit is set, the drive is hidden. Fortunately, in a previous tip...
  • Converting Letters to Numbers and Bit Masks

    Sometimes, you may need to turn characters such as drive letters into numbers or even bit masks. With a little bit of math, this is easily doable. Here is a sample: Let's start with a dirty and unsorted list of drive letters. This is how PowerShell...
  • Checking Size of Downloads-Folder

    Whenever you download something with IE, by default the files get stored in your personal download folder. Often, over time a lot of garbage can accumulate. This line tells you just how much data you store in this folder: $folder = " $env:userprofile...
  • Copying Files in the Background

    In a previous tip we showed how you can use the BITS service to copy files. The main advantage of BITS is that it can copy things silently in the background, and it is resilient to interruptions such as reboots. After a reboot, BITS will continue the...
  • Using Splatting for Better Formatting

    Supplying parameters to a cmdet often results in very long lines like this one: Get-ChildItem -Path $env:windir -Filter * . ps1 -Recurse -ErrorAction SilentlyContinue -Force It lists all PowerShell files located anywhere in your Windows folder. In listings...
  • Copying Large Files with BITS

    You can use Copy-Item or the console applications xcopy and robocopy to copy large files. But did you know that you can also use the BITS service to do this? The BITS service is supposed to download large update files and does so in a very robust way...
  • 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 > ' Test* ' -eq ' * ' False PS > ' Test* ' -like ' ** ' False PS > ' Test '...
  • Extract Paths from Strings Like Environment Variables

    If you'd like to add a path to the %PATH% environment variable, that's easy: PS > $env:path += ' ;c:\newpath ' But how would you remove a path? Here's a clever way: PS > (( $env:path -split ' ; ' ) -ne ' C:\Windows...
  • 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 cmdlet to actually clear such event log, though. With this line, you can: PS > [ System.Diagnostics...
  • Adding Clock to PowerShell Console

    Maybe you'd like to include dynamic information such as the current time into the title bar of your PowerShell console. You could update the console title bar inside your prompt function, but then the title bar would only get updated each time you...
« First ... < Previous 72 73 74 75 76 Next > ... Last »
Copyright 2012 PowerShell.com. All rights reserved.