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
  • Dumping Scheduled Tasks

    There is an underestimated option to make schtasks.exe dump scheduled tasks as CSV data. PowerShell can grab the CSV data and turn it into objects, creating reports with all scheduled tasks in just one line: schtasks.exe /query /fo csv | ConvertFrom-Csv...
  • Get Quotes From the Webservices

    There are plenty of free webservices around, and provided you have direct Internet access (no proxy), you can use New-WebServiceProxy to access them. In a previous tip, we explained how you can access a weather forecast webservice. Today, we'd like...
  • Using Safe Cmdlets Only

    Let's assume you want to set up a restricted PowerShell v3 console that just provides access to Microsoft cmdlets with the verb Get. One way to do this is to create a custom module that publishes the cmdlets you want to keep, then to remove all other...
  • Check Installed Server Roles and Features

    Beginning with Server 2008 R2, there is a PowerShell module called ServerManager that you can use to manage server features and optional components. Simply import the module in PowerShell v2: PS > Import-Module ServerManager In PowerShell v3, the module...
  • Finding Published Printers

    Finding printers that have been published in your Active Directory becomes trivial with Windows 8 or Server 2012. PS > Get-Printer -ComputerName dc1 | Where-Object published ReTweet this Tip!
  • Calculating Time Differences Using Custom Formats

    Calculating time differences is easy - provided you can convert the date and time information into a DateTime type. If the date is in a custom format, you can use the method ParseExact() and submit your own pattern. So if you have custom dates formatted...
  • Get CPU Load

    To get the average total CPU load for your local system or a remote system, use Get-Counter. The example below returns the average total CPU load for a 10 second interval: PS > ( Get-Counter ' \processor(_total)\% processor time ' -SampleInterval...
  • Calling WMI Methods with CIM Cmdlets

    It can be very useful to call WMI methods, for example to create new shares, but in PowerShell v2 you had to know the names and exact order of arguments to submit: $rv = Invoke-WmiMethod -Path ' Win32_Share ' -ComputerName $ComputerName -Name...
  • Temporarily Activate High Performance Power Plan

    It may be useful to automatically and temporarily switch to a "high performance" power plan from inside a script. Maybe you know that a script has to do CPU-intensive tasks, and you would like to speed it up a bit. Here is how a script can change...
  • Listing Power Plans

    There is a somewhat hidden WMI namespace that holds WMI classes you can use to manage power plans. The code below lists all power plans on your local machine, and using -ComputerName, you can easily retrieve this information remotely as well: PS >...
  • Mixing DCOM and WSMan in WMI Queries

    Using the new CIM cmdlets in PowerShell v3, you can run remote WMI queries against multiple computers using multiple remoting protocols. The sample code below gets WMI BIOS information from five remote machines. It uses DCOM for the old machines in $OldMachines...
  • New Operator -In

    In PowerShell v3, you can use a new simplified syntax for Where-Object. Both lines below list all files in your Windows folder that are larger than 1MB: # old syntax: PS > Dir $env:windir | Where-Object { $_ . Length -gt 1 MB } # new alternate simplified...
  • Removing Leading "0" in IP Addresses

    Leading "0" in IP addresses can cause confusion because many network commands interpret octets with leading "0" as octal numbers: # no leading "0": PS > ping 10.10.5.12 Pinging 10.10.5.12 with 32 bytes of data : ( ......
  • CIM-Cmdlets Work Against Old Windows Boxes

    The new CIM cmdlets require PowerShell v3, but you can still remotely target older boxes without PowerShell v3 or PowerShell at all. By default, CIM cmdlets use WSMan for remote connections. If you want to use the old DCOM technique, create a CIMSession...
« First ... < Previous 59 60 61 62 63 Next > ... Last »
Copyright 2012 PowerShell.com. All rights reserved.