Table of Contents
PowerShell is useful for repeatable Windows tasks such as comparing files, checking connectivity and calculating hashes. These capabilities are not all exclusive to PowerShell, and newer Windows versions provide graphical controls for some of them. The advantage is being able to inspect results and combine commands in a reproducible workflow.
Open Windows PowerShell or a PowerShell tab in Terminal. Read each command before running it, replace example names with your own values and work in a folder you are authorized to inspect. These examples do not delete files.
1. Inspect one saved Wi-Fi profile

On current Windows versions, Settings can show the password for a saved network under Network & internet > Wi-Fi > Manage known networks. Select the network and look for Show beside its password. See Microsoft's Wi-Fi connection guidance for the current interface.
For a command-line inspection, list saved profiles:
netsh wlan show profilesThen inspect a single profile you own or are authorized to administer:
netsh wlan show profile name="Your network name" key=clearReplace the example with the saved profile's exact name. Where permitted and available, the security section shows the stored key. Policy and authentication type can affect what is returned; enterprise networks do not necessarily have a shared password to reveal.
netsh is a Windows utility that can also run outside PowerShell. Avoid publishing the output or sharing a screenshot containing credentials. A saved profile also need not contain the network's current password if it has changed.
2. Find duplicate-file candidates without deleting them

First navigate to the folder you want to inspect with Set-Location -LiteralPath "your folder path". Confirm the current location using Get-Location. Then run:
Get-ChildItem -File |
Group-Object Length |
Where-Object { $_.Count -gt 1 } |
ForEach-Object {
$_.Group | ForEach-Object {
Get-FileHash -LiteralPath $_.FullName -Algorithm SHA256
}
} |
Group-Object Hash |
Where-Object { $_.Count -gt 1 } |
ForEach-Object {
"Matching content:"
$_.Group.Path
""
}This checks files directly inside the current folder. It first groups equal sizes, then hashes only groups that could contain duplicates. It does not search subfolders unless you deliberately add recursion, and it does not remove anything.
A matching SHA-256 hash is strong evidence of identical file contents even when names differ. Still review the paths and why each copy exists before removing one: backups and application-managed copies may be intentional. If a file cannot be read, investigate the error rather than treating the scan as complete.
3. Compare responses from several hosts

Test-Connection google.com, microsoft.com -Count 4Test-Connection sends ICMP echo requests. Comparing several destinations can show whether some hosts respond while others do not. The exact output columns vary between Windows PowerShell and newer PowerShell releases.
A ping result is not a download-speed measurement or a website health verdict. A server may block or deprioritize ICMP while its website works normally. Conversely, a host can answer ping while its web application fails. Use the result alongside browser behavior, DNS checks and other symptoms.
See the Test-Connection reference for supported parameters. Avoid describing this simple command as a complete simultaneous website-performance test.
4. Compare a download with its published hash

In the folder containing the downloaded file, calculate its SHA-256 value:
Get-FileHash -LiteralPath "filename.exe" -Algorithm SHA256Compare the entire Hash value with the SHA-256 checksum on the developer's official, authenticated release page. Match the exact version and file. A checksum for another installer or archive will not match.
A mismatch means the bytes differ; do not run the file until you resolve why. A match establishes consistency with that reference, not a guarantee that the software is harmless. If an attacker controls both the download and the checksum page, the comparison alone provides no independent assurance.
Microsoft's Get-FileHash documentation explains the available algorithms. For broader checks, see what to check before opening a downloaded file. The PowerShell command guide offers more examples; verify paths and parameters before adapting any command.
Reader Comments 0
Sign in with email or Google to join the discussion.