August 2012 - 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
  • Find WMI Classes with PowerShell

    In a previous tip we showed how Get-WmiObject can search for WMI class names. Some of the returned WMI class names aren't particularly useful, though, because they are used internally. You can improve search results though by excluding any class that...
  • Finding Files Only or Folders Only

    In PowerShell v2, to list only files or only folders you had to do filtering yourself: Get-ChildItem $env:windir | Where-Object { $_ . PSIsContainer -eq $true } Get-ChildItem $env:windir | Where-Object { $_ . PSIsContainer -eq $false } In PowerShell v3...
  • Export-Csv with Append

    Finally, in PowerShell v3 the cmdlet Export-Csv got a new parameter called -Append! Now you can easily append information to an existing CSV file. Have a look: Get-Process | Export-Csv $env:temp\list.csv -UseCulture -NoTypeInformation -Encoding UTF8 Get...
  • New Alias in PowerShell v3

    Since Select-String is such a useful cmdlet, the PowerShell decided to add an alias to it in PowerShell v3. The alias is called sls. Try this: ipconfig | sls IP In PowerShell v2, you can still use the power of Select-String, you just don't have the...
  • Sharing PowerShell ISE v3 Code Snippets

    In a previous tip we illustrated how you can create code snippets for PowerShell ISE v3 script editor using New-ISESnippet. All custom snippets are stored as XML files in this location: Join-Path ( Split-Path $profile ) ' Snippets ' So if you...
  • Sophisticated Directory Filtering in PowerShell v3

    In PowerShell v3, Get-ChildItem now supports sophisticated filtering through its –Attribute parameter. To get all files in your Windows folder or one of its subfolders that are not system files but are encrypted or compressed, use something like...
  • Restarting Computers in PowerShell

    In PowerShell v3, Restart-Computer now has a number of useful new parameters. For example, you can restart a remote machine and wait for the reboot process to finish. -Wait: Halts the script until the machine has rebooted -Timeout: Seconds to wait for...
  • Colorizing PowerShell ISE v3

    The new PowerShell ISE script editor in PowerShell v3 lets you customize a lot of colors, so if a particular color does not show well on a projector, for example, simply change it. You can do that via GUI, but you can also do it programmatically. For...
  • Out-GridView Grows Up

    In PowerShell v2, Out-GridView was a useful way of displaying information in a separate window but its functionality was limited because you could not return any data (note that Out-GridView is available on servers only when the PowerShell ISE script...
  • Get-Content Can Now Read Raw Text

    In PowerShell v3, Get-Content was reading text files line by line. This was great for pipeline processing but could take a long time and also changed/removed the original line endings. In PowerShell v3, Get-Content now has a parameter -Raw. When specified...
  • Disabling Console Apps in PowerShell ISE

    In PowerShell v3, the new PowerShell ISE script editor has improved a lot. Yet, it still has no real console but instead sports a useful console simulation. Some applications do require a real console, though. If you run those in PowerShell ISE, the editor...
  • Controlling IntelliSense in PowerShell ISE v3

    The new PowerShell ISE script editor that ships with PowerShell v3 has a much improved IntelliSense (code completion) that you can even fine-tune from PowerShell. Here are some interesting options you may want to try: $psISE . Options . IntellisenseTimeoutInSeconds...
  • Removing Code Snippets in PowerShell ISE v3

    In a previous tip we showed you how to add your own little code snippets to the new PowerShell ISE v3 script editor. Here's how you can get rid of code snippets: Get-ISESnippet returns all snippets that you registered previously with New-ISESnippet...
  • Testing URLs for Proxy Bypass

    If you'd like to find out whether a given URL goes through a proxy or is accessed directly, you can use this neat little trick: Function Test-ProxyBypass { param ( [ Parameter ( Mandatory = $true )] [ string ] $url ) $webclient = New-Object System...
  • Using ActiveDirectory Module without AD Drive

    By default, when you import Microsoft’s ActiveDirectory PowerShell module which ships with Server 2008 R2 and is a part of the free RSAT tools, it will import AD cmdlets and also install an AD: PowerShell drive. If you do not want to install that...
1 2 Next >
Copyright 2012 PowerShell.com. All rights reserved.