4 Essential Windows Features Accessible Only Through PowerShell

4 Essential Windows Features Accessible Only Through PowerShell

The capabilities of your Windows computer extend far beyond what is evident in Microsoft’s graphical interface. Beneath the well-known point-and-click functionality lies PowerShell, a potent command-line utility that reveals features not available in typical Windows menus and settings. Despite decades of refining the graphical interface, many of Windows’ practical tools can only be accessed via the command line.

Interestingly, these tools are not overly complex, nor are they solely for developers or system administrators. Although Windows possesses the fundamental functions, the graphical interface fails to present them. Microsoft has intentionally designed Windows in this manner to maintain a clean and user-friendly experience. Adding a GUI for every PowerShell function would lead to an overwhelming number of tools and an unnecessarily complicated interface.

This design choice has left countless users unaware of these valuable capabilities that remain hidden within the command line.

Retrieve Wi-Fi Passwords Stored on Your Computer

Quickly Access Saved Wireless Networks

Revealing saved Wi-Fi passwords using PowerShell
Revealing Saved Wi-Fi Passwords – Screenshot by Jayric Maning (No Attribution Required)

Have you ever been in a situation where you needed to share your Wi-Fi password with a guest, only to forget it? All the Wi-Fi passwords you’ve ever used are stored on your Windows computer. However, Microsoft offers no straightforward option to view them through the standard interface. While you can access the password of your currently connected network via the Control Panel, what about the passwords for other networks you have connected to in the past?

Fortunately, Windows includes the netsh wlan show profiles command, which lists all Wi-Fi network profiles saved on your device. By using a sequence of commands together, you can easily obtain all the stored Wi-Fi passwords. Although the initial command may appear complex, it becomes manageable once you grasp the concepts of pipelines, cmdlets, and parameters. Here’s how it looks:

(netsh wlan show profiles) | Select-String "All User Profile"| %{$name=$_. Line. Split(':')[1].Trim().Replace('"', ''); $_} | %{(netsh wlan show profile name="$name"key=clear)} | Select-String "Key Content"| %{$password=$_. Line. Split(':')[1].Trim(); [PSCustomObject]@{WIFI_NAME=$name; PASSWORD=$password}}

This command enumerates your Wi-Fi profiles and retrieves the corresponding password for each. Within moments, you’ll have an organized list showing every network name alongside its password. Personally, I have employed this command numerous times for setting up new devices or assisting friends who need to connect to networks I have forgotten about.

Instead of typing this command each time, I save it as a PS1 file (which stores PowerShell scripts) in a designated folder. For frequent use, you could also use AutoHotkey to create keybindings for PowerShell commands, enabling instant access.

Identify Duplicate Files Consuming Storage Space

Conserve Storage by Eliminating Duplicates

Revealing duplicate files using PowerShell
Identifying Duplicate Files – Screenshot by Jayric Maning (No Attribution Required)

Many users struggle with disorganized Downloads folders. I experienced this too until I discovered a useful PowerShell feature. Windows lacks a built-in method to detect duplicate files via its standard interface, leading many individuals to accumulate multiple copies of the same documents, images, and videos without realizing it.

PowerShell provides a solution through a concise pipeline command:

Get-ChildItem -File | Group-Object Length | Where-Object {$*.Count -gt 1} | ForEach-Object {$*.Group | Get-FileHash} | Group-Object Hash | Where-Object {$*.Count -gt 1} | ForEach-Object { Write-Host "Duplicate files:"; $*.Group. Path; Write-Host "---"}

This command generates a unique hash for each file’s content, allowing it to identify true duplicates even when filenames differ. I routinely execute this command on my Downloads folder and am consistently surprised by how much space I can recover by removing duplicate files.

The absence of this function in Windows’ GUI is likely due to the resource-intensive nature of duplicate detection, particularly with large files. Microsoft probably determined that most users would not need this feature frequently enough to justify the added complexity to the interface.

Simultaneously Test Your Internet Connection to Multiple Sites

Identify Connectivity Issues Beyond Basic Speed Tests

Testing service connections using PowerShell
Testing Internet Connections – Screenshot by Jayric Maning (No Attribution Required)

When internet connectivity becomes sluggish, most users instinctively rely on speed tests. However, these tests provide data only for a single server. What if the issue lies with specific websites or online services? Windows offers no built-in GUI tool for checking connectivity to multiple sites simultaneously, but PowerShell simplifies this task.

You can use the straightforward Test-Connection command to check various destinations at once:

Test-Connection google.com, facebook.com, youtube.com, microsoft.com

This command pings all four sites at the same time and displays the response time for each. You will quickly determine whether a particular service is having difficulties or if the entire internet connection is slow. I regularly use this when my internet feels unreliable because it provides a clearer view of what is occurring.

Test-Connection google.com, cloudflare.com, amazon.com -Count 10

This variant sends 10 pings to each site, giving you data that can be averaged. If one site consistently exhibits high response times while others perform well, you can conclude that your internet connection is not the underlying issue.

Confirm That Downloaded Files Are Legitimate and Safe

Ensure Safety with File Hash Verification

Comparing download hash to provided legitimate file hash
Hash Comparison for Download Safety – Screenshot by Jayric Maning (No Attribution Required)

Many users favor downloading executables outside of the Microsoft Store. To verify that downloads are safe, you should have a way to check if they originate directly from developers. Numerous legitimate software providers publish hash values with their downloads, acting as unique fingerprints that alter if any part of the file is modified.

PowerShell includes the Get-FileHash command, which allows you to see the file hash of your download (replacing “filename.exe”with your specific filename):

Get-FileHash "filename.exe"

This command generates a SHA256 hash that can be compared to the official hash provided by the software publisher. A match indicates the file is precisely as the publisher intended, while a discrepancy suggests an issue may have occurred during download or that the file has been altered.

Unlock Hidden Functionality with PowerShell

The PowerShell features discussed highlight the powerful functionalities concealed beneath Windows’ amiable interface. While PowerShell may seem daunting, it’s not as intimidating as it appears. Personally, I only utilize a handful of commands, but sufficient to access vital Windows features that many users might believe are absent from Windows altogether.

These functions are not lacking; they simply lie dormant behind a command-line interface that many may never explore. Acquiring knowledge of these basic commands can transform ordinary frustrations into swift solutions. The next time you encounter a limitation within the Windows interface, remember that PowerShell may provide the answer you’re seeking.

Source & Images

Leave a Reply

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