Newbie form questions

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
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.
This topic is 6 years and 2 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.
Locked
User avatar
ocsscott6969
Posts: 48
Last visit: Tue Dec 05, 2023 10:04 am

Re: Newbie form questions

Post by ocsscott6969 »

Ok I think the last question. it works perfect in the IDE but get an error when I run it via windows.

Parm used.

test.exe -p1 2 -p2 “sample text”

same issue if I quote both parms test.exe -p1 "2" -p2 “sample text”

Got error

Exception calling “addseconds” with “1” arguments “value to add was out of range. Parameter name “value”

Code

Param (
$p1,
$p2
)

$form1_Load={

$p3 = "Application: " + $p2 + " Deployment"
$title = "AXA - " + $p2 + " Installation"
$label1.Text = $p3
$form1.Text = $title
$totalseconds = $p1 * 60

$script:StartTime = (Get-Date).AddSeconds($totalseconds)

thanks for all the help
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Re: Newbie form questions

Post by jvierra »

Code: Select all

Param (
     [string]$p1,
     [int]$p2
)
User avatar
ocsscott6969
Posts: 48
Last visit: Tue Dec 05, 2023 10:04 am

Re: Newbie form questions

Post by ocsscott6969 »

Ill give that a shot just confused why it was working so perfect in the IDE command line vs windows after the compile. The IDE must be doing some magic data massage along the way
This topic is 6 years and 2 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.
Locked