Latest Posts
  • Power Tips: Automating Lenovo Driver Downloads (Part 1)

    Many hardware vendors offer web-based self-service portals. Here is an example taken from Lenovo that returns detailed information about driver and other update downloads:

    https://download.lenovo.com/cdrt/tools/drivermatrix/dm.html

    If you need to manage hundreds or thousands of machines or need to regularly…

  • Power Tips: Out-GridView with Custom Columns

    Out-GridView can be a universal dialog when you use the -OutputMode or -PassThru parameters. When you do, a grid view window displays additional buttons in its lower right corner so you can choose items and pass them on to additional cmdlets.

    This line could help picking a service to stop, for example…

  • Power Tips: Accessing Lenovo BIOS Downloads (Part 2)

    In this mini-series we illustrate how you can automate the process of looking up vendor information. While this mini-series focuses on Lenovo and returns the current BIOS update URI for selected models, many of the techniques illustrated here can be reused in similar scenarios as well.

    In part 2 we illustrate…

  • Power Tips: Accessing Lenovo BIOS Downloads (Part 1)

    In this mini-series we illustrate how you can automate the process of looking up vendor information. While this mini-series focuses on Lenovo and returns the current BIOS update URI for selected models, many of the techniques illustrated here can be reused in similar scenarios as well.

    In part 1 we start…

  • Power Tips: Creating New Objects (Part 4)

    While most PowerShell users still use hash tables to create new objects, our previous tips have shown that classes aren’t hard to use and provide a range of advantages. Objects created by hash table conversion aren’t type safe, and you can only define properties. If you want to add methods to your object…

  • Power Tips: Creating New Objects (Part 3)

    While most PowerShell users still use hash tables to create new objects, in the previous tip we introduced classes and their superior type safety. Another benefit are freely definable constructors. This way, you can easily instantiate new objects from your class and at the same time initialize properties…

  • Power Tips: Creating New Objects (Part 2)

    Most PowerShell users use hash tables to create objects, and so did we in the previous tip:

    $o = [PSCustomObject]@{
        Name = "Tobias"
        Id = 19
        Submission = Get-Date
        Birthday = '1999-02-12 18:33:12' -as [DateTime]
    
    }
    
    $o
    

    A much better way is to first define a type-safe…

  • Power Tips: Creating New Objects (Part 1)

    In PowerShell, you can use hash tables to create ad-hoc objects:

    $o = [PSCustomObject]@{
        Name = "Tobias"
        Id = 19
        Submission = Get-Date
        Birthday = '1999-02-12 18:33:12' -as [DateTime]
    
    }
    
    $o
    

    Each hash table key turns into a property, and each value turns into the property…

  • Power Tips: Repair PowerShellGet and Publish-Module

    Publish-Module is a cmdlet used to publish (upload) a module to a NuGet repository. Occasionally, this cmdlet raises strange exceptions. The reason in this case is an outdated version of nuget.exe. This application is responsible for packaging a module and saving it as .nupkg file, and this application…

  • Power Tips: Check for Pending Reboot

    The code below tests whether a reboot is pending:

    $rebootRequired = Test-Path "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\RebootPending"
    "Pending reboot: $rebootRequired"
    



    Twitter This Tip! ReTweet this Tip!