Latest Posts
  • Power Tips: Managing Shortcut Files (Part 3)

    In the previous tip we created new shortcut files, and you have seen how the CreateShortcut() method provides methods to control almost any detail of a shortcut. Here’s the code again that creates a PowerShell shortcut on your Desktop:

    $path = [Environment]::GetFolderPath('Desktop') | 
    • 28 Jul 2021
  • Power Tips: Managing Shortcut Files (Part 2)

    In the previous tip we created new shortcut files, and you have seen how the CreateShortcut() method provides methods to control almost any detail of a shortcut. Here’s the code again that creates a PowerShell shortcut on your Desktop:

    $path = [Environment]::GetFolderPath('Desktop') | 
    • 26 Jul 2021
  • Power Tips: Managing Shortcut Files (Part 1)

    PowerShell creates new LNK files and edits existing ones with the help of an old COM object.

    Let’s first find all LNK files anywhere in your start menu:

    [Environment]::GetFolderPath('StartMenu') | Get-ChildItem -Filter *.lnk -Recurse   
    

    You get back all LNK files found anywhere in your…

    • 22 Jul 2021
  • Power Tips: Unlock Additional PowerShell Modules in Windows 10

    Windows 10 comes with a number of PowerShell modules that you can use to control Server functionality - like WSUS Update Management which is only one example of many.

    In earlier Windows 10 builds, these PowerShell modules were part of so-called RSAT tools (Remote Server Administration Tools), a separate…

    • 20 Jul 2021
  • Power Tips: Enabling ActiveDirectory Module

    Windows 10 ships with the ActiveDirectory PowerShell module – it may just not be enabled yet. If you would like to use PowerShell cmdlets for AD management – i.e. Get-ADUser – simply run the following code with full Administrator privileges:

    #requires -RunAsAdmin
    
    $element = Get-Wi…
    • 16 Jul 2021
  • Power Tips: Forensic Event Log Analysis (Part 2)

    In the previous tip we looked at Get-EventLog to do a forensic analysis and find search-related errors in the Application log. Get-EventLog is simple to use yet it is slow and deprecated. While it is perfectly OK to use Get-EventLog on Windows PowerShell, you might want to switch to Get-WinEvent instead…

    • 14 Jul 2021
  • Power Tips: Forensic Event Log Analysis (Part 1)

    Event logs log almost any aspect of Windows so if something goes wrong or stops working as expected, it is a good idea to include event log forensic strategies into your troubleshooting.

    For example, some users reported that their Windows “Instant Search” stopped finding newer Email items. Why would…

    • 12 Jul 2021
  • Power Tips: Trivia Facts for Birthday Parties

    Let’s assume you are invited to the 37th birthday of a friend. What can you put on the birthday card? Try this:

     
    PS> Invoke-RestMethod -Uri http://numbersapi.com/37 -UseBasicParsing
    37 is the number of plays William Shakespeare is thought to have written (counting Henry IV as three parts).  
    …
    • 8 Jul 2021
  • Power Tips: Splitting without Losing

    When you split texts, you typically lose the splitting character. That’s why the backslash in this example is lost:

     
    PS> 'c:\test\file.txt' -split '\\'
    c:
    test
    file.txt   
     

    IMPORTANT: Note that the -split operator expects a regular expression. If you want to split at backslashes…

    • 6 Jul 2021
  • Power Tips: Sorting Tricks (Part 4)

    In the previous tip we showed that Sort-Object accepts property names, hash tables or plain script blocks to sort things, and we used script blocks to control the sort algorithms, and sort string information by date and time, not alphanumerical.

    In this final example, let’s use this to sort IPv4 addresses…

    • 2 Jul 2021