Life saver & quick question on recovering forms

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
wartech
Posts: 52
Last visit: Wed Jan 03, 2024 9:09 am

Life saver & quick question on recovering forms

Post by wartech »

Product, version and build: PowerShell Studio 2016, 5.2.123
32 or 64 bit version of product: 64
Operating system: Win7 Pro, SP1
32 or 64 bit OS: 64
PowerShell Version: 5

I watched June Blender's videos on creating GUI apps recently and decided to give it a go with a script to analyze our squid proxy logs.
After getting this far (and feeling immensely proud):
Form.png
Form.png (18.18 KiB) Viewed 1815 times
...I built the exe and somehow managed to permanently delete the .psf :o

Today I was browsing around my event logs and spotted some familiar code inside "Applications...\Microsoft\Windows\PowerShell\Operational"
All of my missing code is in there (in several chunks) under event ID 4104, going right back to the earliest version of the form! :D

Absolute life-saver.

My questions are:
Are these events only written to the log by PowerShell Studio when creating forms? (I can only see events related to this 1 script in there).

Some of the events contain sections starting:
Creating Scriptblock text (1 of 14):
#------------------------------------------------------------------------
# Source File Information (DO NOT MODIFY)
# Source ID: 580d1dd7-0648-4672-99c7-a30440bf691c
# Source File: C:\Users\PSharpe\Documents\SAPIEN\PowerShell Studio 2015\Files\Get-ProxyLog.psf
#------------------------------------------------------------------------
#region File Recovery Data (DO NOT MODIFY)
<#RecoveryData:


Is this "RecoveryData" something I can use to save me copying & pasting chunks of script or recreating form settings?

Many thanks
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

Re: Life saver & quick question on recovering forms

Post by davidc »

The event logs were created by the PowerShell engine. This logging is one of the new features introduced in PowerShell V5.

In regards to the form recovery, I have written a few articles detailing the feature:

https://www.sapien.com/blog/2012/08/20/ ... -recovery/

https://www.sapien.com/blog/2014/10/20/ ... -recovery/

The recovery data inserted into the generated script by PowerShell Studio to allow you to restore your form in cases of emergency.
David
SAPIEN Technologies, Inc.
User avatar
wartech
Posts: 52
Last visit: Wed Jan 03, 2024 9:09 am

Re: Life saver & quick question on recovering forms

Post by wartech »

Good to know.

Thanks a lot!
This topic is 7 years and 8 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.