Skip to content

Instantly share code, notes, and snippets.

@thomasrayner
Last active June 28, 2016 21:17
Show Gist options
  • Save thomasrayner/16891b7ad43d8e2260bd506a92cc54e2 to your computer and use it in GitHub Desktop.
Save thomasrayner/16891b7ad43d8e2260bd506a92cc54e2 to your computer and use it in GitHub Desktop.
function something {
[CmdletBinding()]
param(
)
write-verbose 'something verbose'
}
#outputs nothing
something
#outputs the verbose output of the last command
iex "$((get-history)[-1].commandline) -verbose"
#jaykul's better way
&(h -c 1) -verbose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment