Skip to content
Caleb SmithCyberSecurityWithSmitti
Browse PowerShell example contentPowerShell example

02 · Get-Command: check command availability

Verify what command is available and which module supplies it.

How to use it

Run the example before assuming a command/module exists.

Platform and permissions

Standard user; command discovery may trigger module discovery/loading under normal PowerShell behaviour.

What changes / what is read

Reports command metadata.

Scope and interpretation

Names can be shadowed by functions or aliases. Discovery alone does not establish trust in the implementation.

Practice task

Compare CommandType and Source; explain why a familiar name is not a trust guarantee.

Reference

Microsoft documentation. Review the documentation for your installed version and use only an authorised learning or investigation environment.

This is personal educational material. Review the complete code and your signing policy before use. PowerShell code is displayed and downloaded as text; WordPress does not run it. Collection caps limit rows/files, not every provider’s wall-clock execution time.

PowerShell · PowerShell 5.1+ syntax target; Windows collectors require the stated Windows modules. Full Windows acceptance testing remains required.Download .ps1
#requires -Version 5.1
Get-Command -Name Get-WinEvent, Get-FileHash -ErrorAction Stop |
    Select-Object Name, CommandType, Source, Version

Example code is displayed as text. Review it and test in your own lab before use.