7 Best PowerShell Extensions for VS Code (2026)

Best PowerShell extensions for Visual Studio Code

Search the VS Code Marketplace for PowerShell and you get dozens of results, some of them abandoned years ago. We sorted out which ones still earn a spot in a scripting setup. Quick answer: the best PowerShell extensions for VS Code start with Microsoft’s PowerShell extension (ms-vscode.powershell), which already includes IntelliSense, PSScriptAnalyzer, formatting and the … Read more

How to Create a PowerShell Module (Step by Step)

Create a PowerShell module with a .psm1 file and a manifest

To create a PowerShell module, save your functions in a .psm1 file inside a folder with the same name, then load it with Import-Module. That’s the whole minimum: Below I build a small real module step by step: export rules, a manifest, a Public/Private layout, the right install folder and auto-loading. I ran each step … Read more

How to Find an Array Element by Value in PowerShell

Find an array element by value in PowerShell

To find an element in a PowerShell array by value, use -contains to check if it’s there, IndexOf() to get its position, or .Where() to return the matching items: They behave differently with upper and lower case, duplicates and objects. Below I show each one on the same city list. The output was identical in … Read more

PowerShell Get-ItemProperty: Read Registry Values and File Properties

PowerShell Get-ItemProperty reading registry values and file properties

PowerShell Get-ItemProperty reads the properties of an item: registry values under a key, or details like LastWriteTime on a file. Give it a path, and optionally a value name: I’ll cover files first, then the registry, where this cmdlet does its real work. Registry reads are read-only, and demo values live in a throwaway test … Read more

How to Convert PNG to JPG Using PowerShell

Convert PNG to JPG using PowerShell

To convert PNG to JPG with PowerShell, load the image with System.Drawing and save it in JPEG format. It’s built into Windows, so you don’t need to install anything: That works, but transparent areas turn black and you can’t set the quality. Below I fix both with a reusable function, compare quality settings and convert … Read more

How to Get HP BIOS Settings Using PowerShell

Get HP BIOS settings using PowerShell

Rebooting into F10 setup to check one BIOS option gets old fast. HP business PCs expose those options to Windows, so we can read them from a PowerShell window instead. Quick answer: to get HP BIOS settings using PowerShell, run Get-CimInstance against the HP_BIOSEnumeration class in the root\HP\InstrumentedBIOS namespace from an elevated session. Each setting … Read more

How to Convert JPG to PDF Using PowerShell (No Extra Software)

Convert JPG to PDF with PowerShell

To convert a JPG to PDF with PowerShell, print the image to the built-in Microsoft Print to PDF printer with PrintToFile turned on. The PDF lands at the path you give, with no Save As dialog and nothing to install: Below I build that into a reusable function, then convert one photo, combine several receipts … Read more

PowerShell: Convert HTML to Plain Text (Tested in 7 and 5.1)

PowerShell convert HTML to plain text

To convert HTML to plain text in PowerShell, strip the tags with -replace and then decode entities like & with WebUtility.HtmlDecode. For a short snippet, this one line does both: Full pages and email bodies need a bit more care, though. Scripts, styles and line breaks get in the way, and Windows PowerShell 5.1 and … Read more

How to Convert XML to a Table in PowerShell (With Examples)

Convert XML to a table in PowerShell

To convert XML to a table in PowerShell, cast the file to [xml], walk down to the repeating element with dot notation, and pipe those nodes to Format-Table. Each child element and attribute becomes a column: That covers flat files. Real XML has attributes, nested nodes and namespaces, so I’ll also show how to pick … Read more