Advertisement
Lars-UT

Write current PS command history (commands only) to desktop

Jan 11th, 2012
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <# Write current PS command history (commands only) to desktop #> foreach ($i in Get-History){Add-Content ([Environment]::GetFolderPath("Desktop") + "\" +  [string](Get-Date -format "yyyy-MM-dd_HH-mm-ss") + ".ps1.txt") $i.CommandLine}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement