Table of Contents
These PowerShell commands help you inspect files, filter results, check connections, and preview supported changes. Open Windows PowerShell from Start to try the examples; most inspection commands do not require administrator access.
If you are new to the shell, see PowerShell basics and command-line and shell essentials. Run commands in PowerShell, not Command Prompt. Availability can differ between Windows PowerShell 5.1 and PowerShell 7.
12. Get-Help
If you've been learning PowerShell from YouTube videos, one of the first commands that people will mention is Get-Help. As the name suggests, Get-Help helps you find information about PowerShell cmdlets along with their syntax and parameters; it even provides examples of how to use them.
To see how a command works, type Get-Help followed by the command name:
Get-Help Get-Process
This command displays the command summary, syntax, and parameters.
11. Get-Command
While Get-Help provides detailed information about a cmdlet, Get-Command helps you find and list all available commands. For example, if you know what you want to do but don't remember the exact command name, Get-Command helps you find commands based on individual names or patterns.
For example, to try to find all commands containing the word "process", enter:
Get-Command *process*
This lists command names that contain “process”; the asterisks are wildcards.
10. Test-NetConnection
If you use separate tools for ping , telnet , and traceroute , the Test-NetConnection Cmdlet will do all three. This is a network troubleshooting tool, testing whether the problem is on the network, the server, or somewhere else.
For an ICMP reachability check, run:
Test-NetConnection TipsMake.com
This gives ping results and connection information. An unsuccessful ping does not prove a website is down: ICMP may be blocked. To test its HTTPS port, use Test-NetConnection tipsmake.com -Port 443 and inspect TcpTestSucceeded. This tests the TCP connection, not the page content.
9. Get-ChildItem
Get-ChildItem shows the files and folders in any directory. To list your configured Documents folder, including one redirected to OneDrive, use:
Get-ChildItem -LiteralPath ([Environment]::GetFolderPath("MyDocuments"))
You can combine Get-ChildItem with other commands to script and automate batch processing tasks, automating and checking files for matching specific criteria.
8. Where-Object
Where-Object filters objects by their properties. In a script block, $_ represents the current object. For example, filter services by their Status property:
For example, if you need to see all running services, enter this command:
Get-Service | Where-Object {$_.Status -eq "Running"}
7. Select-Object
Often, the command output includes more information than you need. Select-Object lets you select just the data you want. You can then export the selected properties to a CSV file using the Export-Csv cmdlet. To see just the names and status of the services, use:
Get-Service | Select-Object Name, Status
To list five processes with the most accumulated CPU time, use the following. CPU is processor time in seconds, not current CPU utilization:
Get-Process | Sort-Object CPU -Descending | Select-Object -First 5 Name, CPU
6. Get-Member
PowerShell works with objects, and Get-Member shows you their properties and methods. For example, if the command gives you a file, Get-Member can show you the file's size, creation date, and other details. Enter the following command to see the information a process object contains:
Get-Process | Get-Member
This command displays properties like CPU, Id, and WorkingSet, along with methods like Kill() and Refresh().
5. Set-Clipboard and Get-Clipboard
When you have a large amount of PowerShell output that you want to copy, you can either manually select it all or use Set-Clipboard. Manually selecting means scrolling up, starting to select, carefully dragging down, and hoping you don't make a mistake along the way. Set-Clipboard and Get-Clipboard make this whole process much simpler.
To copy the command results to the clipboard, enter the following command:
Get-Process | Select-Object Name, CPU | ConvertTo-Csv -NoTypeInformation | Set-Clipboard
You can now paste the results into Microsoft Excel or any text editor.
4. Out-GridView
This requires a Windows desktop environment and a PowerShell installation that includes the command. If it is unavailable, use Get-Command Out-GridView to check rather than assuming the pipeline is wrong.
Sometimes you need to sort and filter results interactively. Out-GridView opens a separate window with a searchable and sortable table.
Get-Process | Out-GridView
This command will open a new window showing a list of running processes in a GUI table format. Click on the column headers to sort or type in the filter box to search.
3. Get-Process
Get-Process displays every program running on your computer, including memory usage, CPU time, and process ID.
To see all running processes, just type:
Get-Process
2. Get-FileHash
Get-FileHash calculates the hash value of the file contents using the specified hash algorithm. Compare the result with a known, trusted hash for the same file. A hash alone does not establish whether a download is safe. Replace the sample path with an existing file.
To get the SHA256 hash of a file:
Get-FileHash -LiteralPath "C:DownloadsSample.docx" -Algorithm SHA256
1. The -WhatIf parameter
On commands that support it, -WhatIf reports the intended operation without performing that change. It is a parameter, not a separate command, and is not supported by every cmdlet. This option is particularly useful when running Powershell commands to delete, move, or modify files, such as cleaning up old build logs or deploying web resources.
To preview which files will be deleted, add -WhatIf:
Remove-Item -Path "C:Temp*.log" -WhatIf
PowerShell will display each file it will delete but will not delete any files.
Use Get-Help Remove-Item -Examples to inspect supported syntax before adapting a deletion command. Review wildcard paths carefully, even when using -WhatIf.
Reader Comments 0
Sign in with email or Google to join the discussion.