January 2010 - Power Tips

Share |

Join PowerShell.com!
Subscribe to Feed

PowerShell eBook
Sign up for
Your PowerTip of the Day:

Award-winning PowerShellPlus


Admin Guide to PowerShell Remoting


Mastering PowerShell eBook

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
  • Running PowerShell Scripts as a Service

    You should call powershell.exe with the options -noprofile -command like this to run a PowerShell script externally: Powershell.exe -noprofile -command c:\...\script.ps1 Schedule it as a task if you want to run a script as a service. You can simply add...
  • Out-GridView Dirty Tricks

    Out-Gridview is a new cmdlet in PowerShell v.2 which allows you to output objects to a "mini" excel sheet like this: Get-Process | Out-GridView However, this only works if .NET Framework 3.51 is installed. While PowerShell requires just .NET...
  • Remote Access Without Admin Privileges

    In PowerShell v.2, remote access is available only to users who hold local administrator privileges. So, even if you do have appropriate remote access to a machine, you cannot remotely access the system if you are not an Admin. This is not a technical...
  • Use the Force!

    Many cmdlets support the -force switch parameter. With it, the cmdlet will do more than usual. What exactly -force does depends on the cmdlet. For example, Get-Childitem (aka Dir) by default does not list hidden files. However, with -force, it does. Another...
  • Dangerous Keystroke

    You are probably aware of CTRL+C to break the current command. However, you should beware of CTRL+BREAK! This key shortcut will not only break the current command, but will also exit PowerShell immediately so that anything you did not save inside of it...
  • Using MS Access Drivers on 64Bit

    Although 64bit machines have become common place, some techniques are still only 32bit. For example, whenever a PowerShell script tries to access a Microsoft Access database, this only works on 32bit machines because the MDAC drivers used for this are...
  • Childproofing PowerShell

    If you are new to PowerShell, you may be worried about causing unwanted damage or change. One way of childproofing PowerShell is by changing the whatif-default like so: $whatifpreference = $true From now on, any cmdlet supporting the -whatif parameter...
  • Visiting Help Topics

    All Help topics inside of PowerShell are stored as plain text files. You can read them by using Get-Help, but you can also more easily open the appropriate folder in Explorer and do whatever you like, i.e. printing the documents: explorer "$pshome...
  • Secret Parameter Alias Names

    It is important to note that cmdlet parameters can have assigned alias names. They are not always easy to find but they are there. This is why you can say -ea instead of -errorAction. Use this code to locate the alias parameter names of any cmdlet: 'Get...
  • Mixing Parameter Sets

    You will find that some cmdlet parameters belong to different parameter sets. Any cmdlet can use only parameters from one parameter set. You will get an error when you try and mix parameters belonging to different parameter sets.. This is why this command...
  • Cmdlet Alias

    For most cmdlets, there are convenient shortcut names that are the alias names. So whenever you find yourself using a new cmdlet, you should take a second to determine its aliases. This may save you a lot of typing in the future. For example, the next...
  • Finding Cmdlets by Keyword

    You can easily discover the cmdlets suitable for a specific job with the help of a little function: function ??( $keywords ) { Get-Help * | ? { $_ . description -like "*$keywords*" } | Select-Object Name, Synopsis } This "??" function...
  • Copying Help Information (or other things) to Clipboard

    Most people aren't aware that Windows comes with a small application called clip.exe (introduced in Windows Vista). You can use it within the PowerShell pipeline to copy information to the clipboard: Get-Help about_commonparameters | clip ReTweet...
  • Uncovering Parameter Binding

    You should use Trace-Command: if you are ever in doubt about just how PowerShell binds cmdlet parameters to a cmdlet Trace-Command -psHost -Name ParameterBinding { Get-Childitem c:\windows * . log } Simply place the call in question into the brackets...
  • Getting Paginated Help

    Reading Help information using Get-Help is great, but often (especially when specifying the -full or -detailed switch parameter), you retrieve so much information that it is hard to read it all. So a better way is to use "help" instead of "Get...
1 2 Next >
Copyright 2012 PowerShell.com. All rights reserved.