We have PowerShell Studio 2014. I have a basic dialog that has 1 button.
But before the dialog runs I have the following code:
$time1 = Get-Date -Format yyyyMMddhh
$time1
This code is followed by the default Sapien code that runs the Dialog and displays my 1 button.
My problem is this code does not execute and I do not see the output of $time1 in the OUTPUT window. now, if I run the same 2 lines of code in PowerShell ISE they work and I see the yyyymmddhh
How come I don't see any output in the Sapien OUTPUT window?
This code does not run
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: This code does not run
In a GUI Script objects will not "pipe out" because the pipeline is held up by the form's ShowDialog function. If you want to display text, you will need to directly use Write-Host.
But since are using a GUI, it is considered a best practice to display messages within the GUI itself instead of relying on the console.
David
But since are using a GUI, it is considered a best practice to display messages within the GUI itself instead of relying on the console.
David
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.
Re: This code does not run
Here is what I'm trying to do, please let me know if this tool will work.
I need to create an interactive tool that will read the current date/time. Then, compare that date/time to the last time the machine rebooted. If they are 1 week part prompt the user with a dialog that tells them to reboot. But this dialog will have several buttons.
(delay 2 hours)
(delay 4 hours)
(delay 6 hours)
(reboot now)
If any of the delay buttons are pressed when that time is up it will have a 15 min countdown to the reboot.
Am I using the right tool for this?
I need to create an interactive tool that will read the current date/time. Then, compare that date/time to the last time the machine rebooted. If they are 1 week part prompt the user with a dialog that tells them to reboot. But this dialog will have several buttons.
(delay 2 hours)
(delay 4 hours)
(delay 6 hours)
(reboot now)
If any of the delay buttons are pressed when that time is up it will have a 15 min countdown to the reboot.
Am I using the right tool for this?
Re: This code does not run
jvierra, I'd like to write this all myself, I guess I just need a few pointers. I'm new to this tool so can it do what I want it to? I don't want to invent a lot of time into writing this if the tool is not capable of doing what I need.
Thank you.
Thank you.
Re: This code does not run
What have you written so far? From your post it is not possible for me to understand what you are asking. Please post you code so I can try to understand.mqh777 wrote:jvierra, I'd like to write this all myself, I guess I just need a few pointers. I'm new to this tool so can it do what I want it to? I don't want to invent a lot of time into writing this if the tool is not capable of doing what I need.
Thank you.