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

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
  • Sending Objects to Notepad

    In a previous tip we showed how you can send text to a fresh Notepad instance. Today, you get an enhanced version of Out-Notepad: you can pipe anything to Notepad now. If it is not a string, Out-Notepad uses the internal PowerShell ETS to convert it to...
  • Send Text to Notepad

    Notepad can be used to display text results. Typically, you would need to save text results to file, then have Notepad open that file. There is a better way, though: launch an empty Notepad, and send the text via Windows messages directly to the untitled...
  • Magic Underscore Variable

    Here is a very special (and very underdocumented) way to use PowerShell parameters. Have a look at this function: #requires -Version 2 function Test-DollarUnderscore { param ( [ Parameter ( Mandatory = $true , ValueFromPipelineByPropertyName = $true ...
  • Converting Currencies

    PowerShell is an extremely powerful language and can access web services and web pages. If you combine that with dynamic parameters, you get a professional currency converter with real-time exchange rate support. Here is the ConvertTo-Euro function that...
  • Counting Pages in a Word Document

    Let's assume you have a bunch of Word files and would like to know how much pages they contain. Here is a function that takes the path to one Word file and determines its page count: #requires -Version 1 # adjust path to point to an existing Word...
  • Bringing Window in the Foreground

    PowerShell can use Add-Type to access internal Windows API functions. This way, it is easy to bring any process window into the foreground. Here is the function you need: #requires -Version 2 function Show-Process($Process, [ Switch ] $Maximize ) { $sig...
  • Process Data (Part 3)

    In parts 1 and 2, you learned how a PowerShell function can process information that was submitted to parameters or piped via the pipeline. In our third part, we'd like to show how a function can receive text lines and produces one string from it...
  • Process Data (Part 2)

    In part 1 we showed how a PowerShell function can receive input both from a parameter and via the pipeline, and process it in real-time. This is the most efficient way as it minimizes memory consumption. Sometimes, however, it is necessary to first collect...
  • Processing Data (Part 1)

    This is the first of the three tips showing you how a PowerShell function can accept data via pipeline or parameter. In part 1, the function processes the incoming information in real-time. This minimizes memory consumption and provides rapid results...
  • Get UI Information for Processes

    PowerShell can use UIAutomation calls to find out useful UI information about any process. You can find out whether a process accepts keyboard input, whether it is currently visible (and what its window dimensions are), and whether it is a native Win32...
  • PowerShell 5.0 RTM (was) available

    Shortly before Christmas, PowerShell 5.0 RTM was made available to all Windows versions down to Windows 7: http://blogs.msdn.com/b/powershell/archive/2015/12/16/windows-management-framework-wmf-5-0-rtm-is-now-available.aspx . Unfortunately, there was...
  • Compressing to ZIP Files

    In PowerShell 5.0, Compress-Archive can easily compress files and folders to a ZIP file: PS C:\> Compress-Archive -Path c:\sourcefolder -DestinationPath $env:temp\archive.zip -Force Compress-Archive is not a cmdlet, though. It is a function and leverages...
  • Quickly Scanning for Malware

    If you have Windows Defender installed on your machine, you can use this PowerShell command to run a quick scan on a drive of your choice: PS> Start-MpScan -ScanType QuickScan -ScanPath “C:” This command requires the "Defender"...
  • Enabling Telnet Client and Watching Star Wars

    By default, the Telnet client is disabled on Windows systems. You can easily enable it with a one liner in PowerShell, though. Just launch a PowerShell with full Administrator privileges, then run this command: PS C:\> dism /online /Enable-Feature...
  • Enabling PowerShell Remoting with NTLM

    By default, PowerShell remoting uses Kerberos authentication and works only in domain environments, and only when you specify computer names, not IP addresses. To use PowerShell remoting in other scenarios such as peer-to-peer networks at home or in labs...
1 2 3 4 5 Next > ... Last »
Copyright 2012 PowerShell.com. All rights reserved.