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
  • Using PowerShell Remoting without Domain

    PowerShell 3 and later By default, when you enable PowerShell remoting via Enable-PSRemoting, then only Kerberos authentication is enabled. This requires both computers to be in the same domain (or trusted domains), and it only works when you specify...
  • Enabling and Disabling PowerShell Remoting

    PowerShell 3 and later If you want to access a computer remotely via PowerShell, then on the destination side (on the computer you want to visit), run this line of code with Administrator privileges: PS> Enable-PSRemoting -SkipNetworkProfileCheck ...
  • Reading System Logs from File

    All PowerShell Versions Sometimes, you may have to evaluate system log files that have been exported to disk, or you want to read a system log file in “evtx” format directly from a file. Here is how you do this: $path = " $env:windir...
  • WMI Search Tool

    All PowerShell Versions WMI is a great and powerful technique: simply specify a WMI class name, and back you get all the instances of that class: PS> Get-WmiObject -Class Win32_BIOS SMBIOSBIOSVersion : 76CN27WW Manufacturer : LENOVO Name : 76CN27WW...
  • List All Information

    All PowerShell Versions Most of the time, PowerShell will not show you the complete results that you get from cmdlets. Instead, PowerShell limits the results to only the most common pieces of information. PS> Get-WmiObject -Class CIM_CacheMemory BlockSize...
  • Getting US ZIP Codes

    All PowerShell Versions Ever wanted to find out the ZIP code of a city, or vice versa find out the city that belongs to a ZIP code? Then simply ask PowerShell to connect to a free web service and get that information for you: $webservice = New-WebServiceProxy...
  • Reading Registry Values with Type

    All PowerShell Versions Reading all registry values is simple when you do not need the data type: simply use Get-ItemProperty: Get-ItemProperty -Path HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Run If you do need the data type, a little more effort...
  • Finding Files plus Errors

    All PowerShell Versions When you use Get-ChildItem to recursively search directory paths for files, you may stumble across subfolders where you do not have enough privileges. To suppress errors, you may use –ErrorAction SilentlyContinue. That’s...
  • Finding Changeable Properties

    All PowerShell Versions When you get back results from PowerShell cmdlets, the results are objects and have properties. Some properties can be changed, others are read-only. Here is a simple trick to find out the object properties that you can actually...
  • Getting a Variable Inventory

    PowerShell ISE 3 and later For documentation purposes, you may want to get a list of all variables that a PowerShell script uses. Here is a function called Get-Variable: function Get-Variable { $token = $null $errors = $null $ast = [ System.Management...
  • Renaming Variables

    PowerShell ISE 3 and later Here is a simple variable renaming function that you can use in the built-in ISE editor that ships with PowerShell 3 and later. It will identify any instance of a variable and then replace it with a new name. function Rename...
  • Normalizing Line Endings

    All PowerShell Versions When you download files from the Internet, you may run into situations where the file won’t open correctly in editors. Most likely, this is caused by non-default line endings. Here is an example of such a problem. In a previous...
  • Identifying Network Vendors by MAC Address

    All PowerShell Versions Each MAC address uniquely identifies a network device. The MAC address is assigned by a network equipment vendor. So you can backtrack the vendor from any MAC address. All you need is the official IEEE vendor list which is more...
  • Getting MAC Addresses

    All PowerShell Versions Getting the MAC of a network adapter is rather simple in PowerShell. Here is one of many ways: PS> getmac /FO CSV | ConvertFrom-Csv Physical Address Transport Name ---------------- -------------- 5C-51-4F-62-F2-7D \Device\Tcpip_...
  • Advanced Text Splitting

    All PowerShell Versions When you use the –split operator to split text, then the split text is consumed: PS> 'Hello, this is a text, and it has commas' -split ',' Hello this is a text and it has commas As you see, the commas are...
1 2 3 4 5 Next > ... Last »
Copyright 2012 PowerShell.com. All rights reserved.