echo "hello! starting..."
sleep 5; echo "hello after 5 secs..."
sleep 5; echo "hello after 10 secs..."
sleep 5; echo "hello after 15 secs..."
sleep 5; echo "hello after 20 secs..."
sleep 5; echo "hello after 25 secs..."
sleep 5; echo "hello after 30 secs..."
echo "finished!"
I saved it as test1.ps1 in my user folder. When I run it normally…
PS C:\Users\jatwo> .\test.ps1
hello! starting...
hello after 5 secs...
hello after 10 secs...
hello after 15 secs...
hello after 20 secs...
hello after 25 secs...
hello after 30 secs...
finished!
OK same thing but I will select text while it is running… yes, confirmed, it never advances:
You see how I have selected text there, “after 10”. No other console text appears. Pressing esc to cancel the selection – or pressing enter to copy the selection – lets the console continue working. Make sure you don’t have text selected in the console, press enter or esc to be sure, I guess?
Thanks for sharing! I do think this was kinda known, but now hopefully more people know about it
if you’re on Windows, I have had luck going to Resource Monitor and suspending plotting processes. It picks it back up afterwards. Typically it only gets used for me if I end up playing Warzone or something
This gave me an idea - couldn’t we run the plotter inside a VM and then just suspend the whole VM as needed? Disk IO and processor performance should be close to native on any modern architecture…
Absolutely, I’ve done this with VM’s with active network connections even - suspend the VM, reboot the host, resume the VM, and as long as there was no TCP timeout - everything still active.