Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

[PS] Cycling through console input history after importing history

$
0
0

Hallo fellow scripters,

What I'm trying to do
I'm trying to add a functionality to PowerShell that allows me to import the command history of a PS User and actually adds these commands not merely to the command history (which I can call with Get-History), but actually introduce them in a way, that allows to user to access them simply by pressing key "Cursor:Up"-Key, as if cycling through the commands entered in the current console session.

What I've tried
First of all, I tried doing things with Add-History and Get-History, like:

Get-History | Export-CSV $Path
Import-CSV $Path | Add-History

This works in adding the entries to the history I can call up with Get-History, however it's not possible to comfortably cycle through the commands.

Looking at the System.Console class, alas, didn't yield any spontaneous inspiration either.

So ... anybody an idea how to pull this off?

Cheers,
Fred


There's no place like 127.0.0.1


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>