Search found 11743 matches

by jvierra
Fri Jan 19, 2018 5:59 pm
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

You have to insert the snippet. It is in the snippet GUI folder. I am tryin to get you to realize that you can be independent if you just look around PSS and see how it is built.

I suggest that you start by reading the PSS manual linked on the help tab.
by jvierra
Fri Jan 19, 2018 5:24 pm
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

Just output the format that you want. Do you understand how to work with strings?
by jvierra
Fri Jan 19, 2018 4:37 pm
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

by jvierra
Fri Jan 19, 2018 4:35 pm
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

ocsscott wrote:
Fri Jan 19, 2018 3:26 pm
and a follow up general question when I end the form with exit what return code will it give to the OS?

I will be running this via sccm and want to get an exit code 0 when the form closes.
Any return code you choose.
by jvierra
Fri Jan 19, 2018 3:08 pm
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

Here is a little different approach with a bonus movable textbox.
by jvierra
Fri Jan 19, 2018 3:04 pm
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

Use a timespan and set it to a value. Subtract each timer tick and assign it to the label.

# get a timespan
$ts = [timespan]'0:0:10:0'
# subtract one second
$ts.Subtract('0:0:0:1')
# display as string
"$ts"
by jvierra
Fri Jan 19, 2018 8:53 am
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

Here is the best way to pass parameters into a form that will be packaged. Param ( $p1, $p2 ) $form1_Load={ $label1.Text = $p1 $label2.Text = $p2 } This can be called: PS D:\scripts> D:\TEST\bin\x64\NamedParams.exe -p1 test1 -p2 test2 PS D:\scripts> D:\TEST\bin\x64\NamedParams.exe test1 test2 The "e...
by jvierra
Fri Jan 19, 2018 8:36 am
Forum: PowerShell GUIs
Topic: Newbie form questions
Replies: 32
Views: 501

Re: Newbie form questions

Cody - you don't have to zip PSF files. Just attach them which makes downloading much easier.
by jvierra
Fri Jan 19, 2018 8:32 am
Forum: PowerShell GUIs
Topic: Switch statement
Replies: 11
Views: 255

Re: Switch statement

Load the CSV globally. Place it outside of any event or function.

You should put the header in the CSV file. You don't need to specify the delimiter if it is a comma.

You can also do this in the "Load" event:

$global:csv = Import-Csv '\\remotepath\Get-AppsModelSwitch.csv'
by jvierra
Fri Jan 19, 2018 7:27 am
Forum: PowerShell GUIs
Topic: Switch statement
Replies: 11
Views: 255

Re: Switch statement

You can easily use a combobox as a label.

You can also just filter the CSV:

$label.Text = ($csv | Where{$_.Column1 -eq 'somevalue'}).Column2