From Burnt to Saved: How PSAfterSession Keeps Your Bacon Safe
summary
PSAfterSession is a PowerShell module that auto-saves session state with a background System.Timers.Timer and Register-ObjectEvent/Register-EngineEvent hooks, exporting each variable to separate Export-Clixml files and skipping a host-specific blacklist and credential types. Reimported objects become deserialized so methods vanish (demo shows original objects with 69 properties and 19 methods dropping to only 2 methods), it recovers plain data well in demos but loses live behavior and offers no current mitigation for out‑of‑memory recreation.
AI-written summary · about
chapters (11)
- 0:00Introduction
- 2:41Sessions burn need safety
- 4:06Auto-save with PowerShell timers
- 6:32Smart variable capture
- 8:19CLIXML snapshot limits
- 10:26Reimported objects dangers
- 13:14Safety and user experience
- 16:25Handling credentials
- 18:11Cleanup with engine events
- 19:37Module availability
- 20:19Q&A
related talks
34mWhip Your Scripts into Shape: Optimizing PowerShell for Speed
43mAdvanced PowerShell Eventing Scripting Techniques
01h 30mConjuring data with APIs
41m"Let's Talk PS Cresendo" Powershell
01h 29mModularizing PowerShell: Making Code Portable
38m"Piping" data between packaged scripts
45mPlatform PowerShell
05mOps Tooling and Retro Video Games
