PowerShell Modules That Transformed My Workflow

PowerShell Modules That Transformed My Workflow

If you are still relying on custom PowerShell scripts for simple file transfers or generating Excel reports, it’s time to streamline your workflow. Pre-built PowerShell modules can handle most routine tasks far more efficiently than anything you might script manually.

To begin using these modules, ensure you are running at least PowerShell 5.1. While many modules are compatible with PowerShell 7 across various platforms, some may be limited to Windows. It’s also crucial to enable script execution by adjusting your execution policy as follows:

Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned -Force

When installing modules, consistently use the -Scope CurrentUser parameter to eliminate the need for administrative permissions.

6 PSReadLine

Included by default with PowerShell, PSReadLine often goes underutilized, even by seasoned users. This module enhances your command-line experience with features such as syntax highlighting, multi-line editing, and predictive IntelliSense capabilities.

PowerShell terminal with the PSReadLine module installed
Image credit – self captured (Tashreef Shareef) – No Attribution Required

To get the latest version of PSReadLine, use the following command:

Install-Module -Name PSReadLine -Scope CurrentUser -Force

Enabling IntelliSense will enhance your command history, providing suggestions as you type. Activate it with:

Set-PSReadLineOption -PredictionSource HistorySet-PSReadLineOption -PredictionViewStyle ListView

With a few prior commands executed, such as ipconfig or Get-Service, IntelliSense will suggest options from your history as you begin typing. You can navigate these suggestions using the Up and Down arrow keys, confirming your selection with the Enter key.

5 ImportExcel

With over 14 million downloads, ImportExcel is a popular choice for users wanting to create Excel spreadsheets without the need for Excel itself—ideal for server environments or automation scripts.

Import Excel module on PowerShell terminal
Image credit – self captured (Tashreef Shareef) – No Attribution Required

To install ImportExcel, enter the following command:

Install-Module -Name ImportExcel -Scope CurrentUser

This module can perform tasks ranging from basic exports to more complex functions such as pivot tables and conditional formatting. For example, to export information about running processes to a formatted spreadsheet, use:

Get-Service | Where-Object {$_.Status -eq "Running"} |Export-Excel -Path "ServiceReport.xlsx" -AutoSize -TableStyle Medium9 -FreezeTopRow

This command gathers all active services and exports them to an Excel file, formatting the columns to fit the content and freezing the header row for convenience.

Excel report generated by ImportExcel
Image credit – self captured (Tashreef Shareef) – No Attribution Required

4 PSWriteHTML

PSWriteHTML allows you to transform PowerShell output into HTML reports, complete with tables and charts, requiring no prior knowledge of HTML coding.

PSWriteHTML module export command
Image credit – self captured (Tashreef Shareef) – No Attribution Required

Install the module with the command:

Install-Module -Name PSWriteHTML -Scope CurrentUser

To create a system report highlighting the top ten processes by CPU usage, use:

Import-Module PSWriteHTML;$procs = Get-Process | Select-Object Name, CPU, WorkingSet -First 10New-HTML -TitleText "System Report" -FilePath "Report.html" -ShowHTML {New-HTMLSection -HeaderText "Process Information" {New-HTMLTable -DataTable $procs -Filtering -Buttons @('copyHtml5', 'excelHtml5')}}

The generated HTML features JavaScript-driven sorting, filtering, and export capabilities.

PSWriteHTML module export result
Image credit – self captured (Tashreef Shareef) – No Attribution Required

3 PSWindowsUpdate

As the most popular module on the PowerShell Gallery with over 33 million downloads, PSWindowsUpdate offers cmdlets specifically designed to manage the Windows Update Client.

PSWindowsUpdate PowerShell module
Image credit – self captured (Tashreef Shareef) – No Attribution Required

Install it using the following command:

Install-Module -Name PSWindowsUpdate -Scope CurrentUser

This module provides cmdlets for comprehensive Windows Update management—ideal for automating tasks. Check for pending updates on multiple servers simultaneously with:

$Servers = 'SERVER01', 'SERVER02', 'SERVER03'Invoke-Command -ComputerName $Servers -ScriptBlock {Import-Module PSWindowsUpdate<|image_sentinel|>Get-WindowsUpdate -MicrosoftUpdate | Select-Object @{n='Computer';e={$env:COMPUTERNAME}}, KB, Title, Size, IsDownloaded, IsInstalled, RebootRequired} | Sort-Object Computer, KB | Format-Table -AutoSize

This quickly reveals pending updates across your servers. You can install specific updates, hide problematic ones, or schedule installations conveniently. Utilize the -AcceptAll parameter to bypass confirmation prompts.

2 Terminal-Icons

Revamp your PowerShell terminal experience with Terminal-Icons, which adds recognizable icons to files in directory listings. Each file type is represented with its unique icon and color, improving visibility and ease of navigation.

Terminal-Icons PowerShell module
Image credit – self captured (Tashreef Shareef) – No Attribution Required

To install, run:

Install-Module -Name Terminal-Icons -Scope CurrentUser

This module enhances the output of Get-ChildItem. After installation, to see the icons, use:

Import-Module Terminal-Icons

Subsequently, when running Get-ChildItem or its aliases, each file type will display its respective icon and color. PowerShell scripts will present the PowerShell logo, and folders will show designated folder icons. Not only does this aesthetic upgrade improve the look of your terminal, but it also helps in quickly identifying files while navigating between tabs. Please note that installing a Nerd Font is necessary for the icons to render correctly.

Terminal-Icons PowerShell module with Get-ChildItem
Image credit – self captured (Tashreef Shareef) – No Attribution Required

1 Transferetto

Transferetto is a PowerShell module designed to simplify interaction with FTP, FTPS, and SFTP. Instead of delving into. NET classes or utilizing third-party tools, it offers intuitive, PowerShell-native cmdlets.

Transferetto PowerShell module
Image credit – self captured (Tashreef Shareef) – No Attribution Required

To install Transferetto, use:

Install-Module -Name Transferetto -Scope CurrentUser

The workflow closely mirrors that of database modules: connect, execute tasks, and disconnect:

$Client = Connect-FTP -Server "ftp.example.com" -Credential (Get-Credential)Send-FTPFile -Client $Client -LocalPath "C:\Reports\Report1.xlsx" -RemotePath "/uploads/"Disconnect-FTP -Client $Client

Beyond basic functions, Transferetto accommodates SSL configurations, encryption methods, certificate validation options, and the Request-FTPConfiguration command, which can automatically test your server connection settings.

Additionally, it isn’t restricted to single files; you can upload entire directories using Send-FTPDirectory or even perform FXP transfers (server-to-server file copying).With support for SFTP and SSH, it also allows you to run remote commands in conjunction with your file transfers.

Because Transferetto operates on both Windows PowerShell 5.1 and PowerShell 7+, your scripts remain functional across Windows, Linux, and macOS platforms without requiring any modifications.

Even if your use of PowerShell is limited to basic tasks, familiarizing yourself with several modules can transform your efficiency. Modules like PSReadLine accelerate typing with predictive suggestions, ImportExcel enables easy spreadsheet management without Excel, and Terminal-Icons enhance the readability of your terminal interface.

A vast array of modules is available on the PowerShell Gallery. Be sure to review their compatibility and update history before installation. Begin with one or two modules that directly address your most pressing needs, then gradually expand your toolkit as you become more comfortable.

Source&Images

Leave a Reply

Your email address will not be published. Required fields are marked *