{"id":14063491,"url":"https://github.com/ironmansoftware/restore","last_synced_at":"2025-07-29T15:33:39.936Z","repository":{"id":98025633,"uuid":"299159839","full_name":"ironmansoftware/restore","owner":"ironmansoftware","description":"Ctrl+Shift+T for PowerShell Terminals","archived":false,"fork":false,"pushed_at":"2020-09-28T02:12:41.000Z","size":351,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-13T07:05:06.563Z","etag":null,"topics":["powershell"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ironmansoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-09-28T01:59:47.000Z","updated_at":"2024-02-24T21:34:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a40fc05-924f-45aa-b3cb-6ecc83057995","html_url":"https://github.com/ironmansoftware/restore","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ironmansoftware%2Frestore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ironmansoftware%2Frestore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ironmansoftware%2Frestore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ironmansoftware%2Frestore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ironmansoftware","download_url":"https://codeload.github.com/ironmansoftware/restore/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228028454,"owners_count":17858337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["powershell"],"created_at":"2024-08-13T07:03:21.960Z","updated_at":"2024-12-04T01:30:55.110Z","avatar_url":"https://github.com/ironmansoftware.png","language":"PowerShell","funding_links":[],"categories":["PowerShell"],"sub_categories":[],"readme":"# Restore\n\nRestore saves the state of your terminal so you can restore it the next time you open one. \n\n![](./example.gif)\n\n## Disclaimer\n\nThis is probably not a great idea. Every time you execute a command, this module serializes your location, variables and loaded modules to a CLIXML file. \n\n## How to use\n\nInstall the module. \n\n```\nInstall-Module Restore\n```\n\nAdd it to your profile.\n\n```\nImport-Module Restore\n```\n\nRestore terminals that you closed previously.\n\n```\nRestore-Terminal\n```\n\nAfter restoring a terminal, the following will be restored.\n\n- Location\n- Variables\n- Modules\n\n## How it works\n\nIf you want to use this module, load it into your PowerShell profile. \n\n```\nImport-Module Restore\n```\n\nWhen you import the module, it assigns an event handler to the `AvailabilityChanged` event of the main runspace. \n\n```\n$Host.Runspace.add_AvailabilityChanged({Checkpoint-Terminal})\n```\n\nEvery time the runspace changes state (like when it completes running a command), it will call `Checkpoint-Terminal`. This will create a hashtable with your session state, serialize it to CLIXML and save it to disk. \n\n```\n$state = @{\n    Location = (Get-Location).ToString()\n    Variables = Get-Variable -Scope \"Global\" | ForEach-Object { [PSCustomObject]@{ Name = $_.Name; Value = $_.Value } }\n    Modules = Get-Module | ForEach-Object { [PSCustomObject]@{ Name = $_.Name; Path = $_.Path } }\n}\n\nStart-Job -ScriptBlock {\n    $args[0]  | Export-Clixml -Path \"$Env:AppData\\restore.$pid.clixml\"\n} -ArgumentList $state\n```\n\nIf you close a terminal that you didn't mean to close, you can call `Restore-Terminal` in a new PowerShell window to load up the terminal state. Kinda like `Ctrl+Shift+T` in a browser. ","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironmansoftware%2Frestore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fironmansoftware%2Frestore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fironmansoftware%2Frestore/lists"}