Created
September 16, 2019 03:17
-
-
Save jetstreamin/5d88f779ca69cc8a55bd4fe68dd7d98a to your computer and use it in GitHub Desktop.
PowerShell - Fingerprint Commands and Server Information
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Write-Output 'Hello World' | |
$env:computername | |
## Function to fingerprint commands executed during the execution of this runbook | |
Function Invoke-Fingerprint { | |
param ( $cmd ) | |
Write-Output '---------------------------' | |
Write-Output $cmd | |
Invoke-Expression $cmd | |
} | |
Invoke-Fingerprint -cmd '$PSVersionTable' | |
Invoke-Fingerprint -cmd 'Get-Module' | |
Invoke-Fingerprint -cmd 'Get-Module -ListAvailable' | |
Invoke-Fingerprint -cmd 'Get-Process' | |
Invoke-Fingerprint -cmd '$pwd' | |
Invoke-Fingerprint -cmd 'Get-ChildItem $pwd' | |
Invoke-Fingerprint -cmd 'Get-ChildItem C:\' | |
Invoke-Fingerprint -cmd 'Get-PSDrive' | |
Invoke-Fingerprint -cmd 'Get-ChildItem Env:' | |
Invoke-Fingerprint -cmd 'Get-ExecutionPolicy' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment