Re-Running Powershell History

Claudio Silva shows how to re-run statements in your Powershell history:

While we were running some commands we talked about Get-History cmdlet.

For those who don’t know

this cmdlet lists all the commands that you already ran on the current session.

I wondered if it is possible to pipe the Get-History output and run it again. I could bet yes but I never tried before.

The answer is that yes, you can, and Claudio shows how.

Related Posts

Checking If UseLargeFRS Is Enabled

Cody Konior has a quick post showing how to see if you have the UseLargeFRS switch turned on for your SQL Server disks: PureStorage has a pretty cool post that mentions the importance of formatting SQL Server disks with a 64KB clusters and the /L flag (also known as the UseLargeFRS switch on PowerShell’s Format-Volume cmdlet). […]

Read More

Installing dbatools

Chrissy LeMaire has a good walkthrough on how to install a module from the Powershell gallery, using dbatools as an example: It’s easy for PowerShell toolmakers to forget that new users may have questions about ExecutionPolicy and Repositories. If dbatools is the first module you’ve ever installed and used, this guide is intended to help […]

Read More

Categories