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
  • Colorful Console

    PowerShell 5 PowerShell 5.0 on Windows 10 ships with a much-enhanced and colorful PowerShell console. PowerShell 5.0 on other operating systems just has the dull standard console. That's because the console enhancements come from a module called "PSReadLine"...
  • Finding AD User by SAMAccountName

    PowerShell 5 The free Microsoft RSAT tools come with a full-blown ActiveDirectory module, but sometimes simple AD tasks can be mastered with just a bit of .NET code, and no dependencies to the RSAT tools. As an example, here is a function that can search...
  • Finding Nested Object Secrets

    PowerShell 2+ Objects can have a nested and complex inner structure, and it can be tiresome to examine properties one by one. Here is a simple approach to turn the structure of an object into text: # find nested object elements up to a given depth $test...
  • Checking Success of Command

    PowerShell 3+ Often, all you want is suppress errors, and find out whether a given cmdlet worked or not. Here is a very simplistic approach that does just this: $service = Get-Service -Name AdobeARMservice44 -ErrorAction Ignore $ok = $? No error messages...
  • Creating Parameters with Dynamic IntelliSense

    PowerShell 3+ Today, we dive a little deeper in the programming part, and show you how a PowerShell function can have parameters that have dynamic intelliSense completion. The goal is to define a function called “Manage-Service” with the –Service...
  • Getting New NTFS Cmdlets

    PowerShell 3+ / PowerShellGet In the previous tip we explained PowerShellGet. This module ships with PowerShell 5.0 but is available for download on www.powershellgallery.com for PowerShell 3.0 and 4.0 as well. Once you have it installed, you can easily...
  • Exporting Modules across the Network

    PowerShell 3+ Did you know that you can easily export modules from other computers to your local machine? Assume you don’t have the RSAT tools but would like to use their cmdlets to administer Active Directory, or you’d like to use the ServerManager...
  • Debugging Other PowerShell Processes

    PowerShell 5 Beginning with PowerShell 5.0, the PowerShell ISE can connect to other processes that run a PowerShell runspace, display the source code, and debug the foreign process. This is great news because now you can debug PowerShell code that runs...
  • Use CredSSP to Fight Double-Hop Networking Issues

    PowerShell 2+ If you do PowerShell remoting, you may have experienced “double-hop” problem. It occurs when you try to pass on your identity from the remote code to a 3rd party. Simple example: the remote code wants to access a file share and...
  • Reading NTFS Permissions

    PowerShell 2+ NTFS permissions are represented by complex object hierarchies that are hard to read. A much simpler way is to output the structure in an SDDL (Security Descriptor Definition Language) format: $sd = Get-Acl -Path c:\windows $sd . GetSecurityDescriptorSddlForm...
  • New Delayed Output in PowerShell 5.0

    PowerShell 2+ Let’s do two things. First, have a look at a useful small new function that does DNS resolution. Then, let’s discuss why this function can behave differently in PowerShell 5.0. Here is the function: function Get-HostByName {...
  • Creating Your Private PowerShellGet Repository

    PowerShell 3+ / PowerShellGet In the previous tip we introduced PowerShellGet and showed how you can install this module from www.powershellgallery.com if you are using PowerShell 3.0 or 4.0 (it ships with 5.0). You also learned how you can use the cmdlets...
  • Test-Driving PowerShellGet Module

    PowerShell 3+ PowerShell 5.0 ships with a new module called PowerShellGet, and on older PowerShell versions, you can easily download and install this module from www.powershellgallery.com . With it, you have a bunch of new cmdlets that can search for...
  • Type-Based Parameter Binding (Part 2)

    PowerShell 2+ In a previous tip we introduced automatic type-based parameter binding. Here is a use case. The function Test-Binding accepts files and folders. For incoming files, it calculates the file size. For incoming folders, it emits a warning. Note...
  • Understanding Type-Based Parameter Binding

    PowerShell 2+ PowerShell can automatically bind arguments to parameters based on type. Simply define different parameter sets. Here is an example: function Test-Binding { #Content [ CmdletBinding ( DefaultParameterSetName = ' Number ' )] param...
< Previous 1 2 3 4 5 Next > ... Last »
Copyright 2012 PowerShell.com. All rights reserved.