Latest Posts
  • Power Tips: Prompting for Credentials in Console

    When you run Get-Credential or are otherwise prompted for a username and password, Windows PowerShell (powershell.exe) always opens a separate credentials dialog. The new PowerShell 7 (pwsh.exe) prompts inside the console:

     
    PS> Get-Credential 
    
    PowerShell credential request
    Enter your credentials.
    User…
    • 26 May 2020
  • Power Tips: Searching PowerShell Gallery for New Modules

    The official PowerShell Gallery is a public repository with thousands of free PowerShell modules. Instead of reinventing the wheel, it makes total sense to browse the gallery for reusable code that you can use as-is or as a starting point for your own projects. Let’s take a look at how you can discover…

    • 22 May 2020
  • Power Tips: Managing SharePoint Online

    If you use SharePoint Online and would like to manage it via PowerShell, download and install the Microsoft.Online.SharePoint.PowerShell module from the PowerShell Gallery:

     
    # search for the module in PowerShell Gallery (optional)
    PS> Find-Module -Name Microsoft.Online.SharePoint.PowerShell
    
    Version…
    • 20 May 2020
  • Power Tips: Identifying Compromised Passwords (Part 2)

    When you want to submit sensitive information to a PowerShell function, you typically use the SecureString type. This type makes sure a user gets prompted with a masked dialog box, and the input is protected from anyone “looking over the shoulder”.

    Since SecureString can always be decrypted…

    • 18 May 2020
  • Power Tips: Identifying Compromised Passwords (Part 1)

    Passwords are no longer considered safe when they are complex. Instead, you need to ensure that passwords have not been compromised and are not part of default attacker dictionaries. Even the most complex password is unsafe if it is routinely checked by automated attacks.

    To find out whether a password…

    • 14 May 2020
  • Power Tips: Create Software Inventories

    The Windows registry stores the names and details of all software that you installed. PowerShell can read this information and provide you with a complete software inventory:

    # read all child keys (*) from all four locations and do not emit
    # errors if one of these keys does not exist
    Get-ItemProper…
    • 12 May 2020
  • Power Tips: Keep PowerShell Modules Up-To-Date

    It’s important to check every now and then that your PowerShell modules are up-to-date. If you are using old and outdated modules, you can run into issues, just like using old and outdated software in general.

    For example, the PowerShellGet module provides cmdlets like Install-Module that let you…

    • 8 May 2020
  • Power Tips: Adding New PowerShell Commands

    PowerShell is just a scripting platform and can be extended with new commands. A great source for new commands is the public PowerShell Gallery. You can visit the graphical front-end at https://powershellgallery.com and search for modules.

    PowerShell comes with a module called PowerShellGet which in…

    • 6 May 2020
  • Power Tips: Getting Help for WMI Objects

    WMI is extremely powerful but a little underdocumented. To change this, a group has formed and is creating a PowerShell-specific WMI reference: https://powershell.one/wmi

    To easily look up help, you can add the Help() method to all of your WMI and CIM instance objects. Simply run this code:

    $codeCim
    • 4 May 2020
  • Power Tips: Reading Chassis SKU

    In Windows 10 and Server 2016, WMI added a new property that simplifies collecting chassis or enclosure SKUs. This one-liner reads the SKU for you:

     
    PS> Get-CimInstance -ClassName Win32_ComputerSystem | Select-Object -Property Name, ChassisSKUNumber
    
    Name            ChassisSKUNumber
    ----           …
    • 30 Apr 2020