Hello,
Thanks to the PowerShell ISE object, you can do some useful things.
Function Save-IseSession{ [CmdletBinding()] Param( [Parameter(Position=0)] [String]$Path = "$env:tempIse.txt" ) Begin{ } Process{ $psISE.CurrentPowerShellTab.Files | % {$_.SaveAs($_.FullPath)} "ise ""$($psISE.PowerShellTabs.Files.FullPath -join',')""" | Out-File -Encoding utf8 -FilePath $Path } End{ } } Function Restore-IseSession{ [CmdletBinding()] Param( [Parameter(Position=0)] [String]$Path = "$env:tempIse.txt" ) Begin{ } Process{ Invoke-Expression (Get-Content $Path) } End{ } }
Those two functions allow you to save and restore your ISE opened PowerShell scripts. You need to add those lines to your PowerShell profile to use it anytime you need it :
#Profile Folder ($env:psmodulepath -split ';')[0] #Profile file name ($profile -split "")[-1] #All profiles informations $PROFILE | select *
Pingback: Save and Restore PowerShell ISE opened scripts - Addon - It For DummiesIt For Dummies
Pingback: Save and restore ISE session path and opened files enhanced – Thomas Prud'homme