Search found 16 matches

by v_2nas
Wed Mar 07, 2018 10:25 pm
Forum: PowerShell Studio
Topic: Question | Powershell script as service
Replies: 3
Views: 1867

Re: Question | Powershell script as service

Hi David, I followed the first article and converted the following script into service. The service is running but i don't see any data coming in. If i manually start the script, i can see the data coming in. ### Create a MetricDatum .NET object $Metric = New-Object -TypeName Amazon.CloudWatch.Model...
by v_2nas
Tue Mar 06, 2018 10:01 pm
Forum: PowerShell Studio
Topic: Question | Powershell script as service
Replies: 3
Views: 1867

Question | Powershell script as service

Hi, I am running PS 2017 x64 on Windows 10 x64. I have a question regarding converting powershell scripts into Service. I have a script which continuously probe VPN tunnel status using ICMP requests. The script using do while loop and runs infinitely. Now, If i convert this script into service, will...
by v_2nas
Sun Nov 20, 2016 6:35 pm
Forum: PowerShell GUIs
Topic: RichTextBox multi color lines
Replies: 2
Views: 2593

Re: RichTextBox multi color lines

Thanks for the help. That was a quick fix :)
by v_2nas
Fri Nov 18, 2016 1:06 am
Forum: PowerShell GUIs
Topic: RichTextBox multi color lines
Replies: 2
Views: 2593

RichTextBox multi color lines

Hi,

Is it possible to display multi color lines in richtextbox with autoscroll? For example Informational messages goes in green, warning in orange and errors in red. I have written a simple psf code but it $richtextbox.forecolor changes text of entire output instead of selective output.
by v_2nas
Thu Nov 17, 2016 11:29 pm
Forum: PowerShell GUIs
Topic: Referencing Variables across the events
Replies: 10
Views: 4531

Re: Referencing Variables across the events

Thanks for the explaining it patiently. It makes much more sense now when working with PS 2016.
by v_2nas
Thu Nov 17, 2016 5:57 pm
Forum: PowerShell GUIs
Topic: Referencing Variables across the events
Replies: 10
Views: 4531

Re: Referencing Variables across the events

Actually, I am using the same variable across the script, for example, I create a variable and then i use it at different places in the script without having to prefix it with $script. When you say defined a variable in outscope, do you mean, outside the form function? and do you mean all the variab...
by v_2nas
Thu Nov 17, 2016 1:17 am
Forum: PowerShell GUIs
Topic: Referencing Variables across the events
Replies: 10
Views: 4531

Re: Referencing Variables across the events

I read this post https://www.sapien.com/blog/2013/04/10/powershell-scoping-revisited/ as per it, if we need to access variable across different events, we need to use scope the variable using script. Is that correct? My script would only work if use define scope as script for the variable otherwise,...
by v_2nas
Wed Nov 16, 2016 6:57 pm
Forum: PowerShell GUIs
Topic: Referencing Variables across the events
Replies: 10
Views: 4531

Re: Referencing Variables across the events

are you saying that if i am using powershell studio inbuilt controls/functions then it's better to call them using the following way across the script rather than storing them in another variable and using that variable. $InvoicePath = $folderbrowsermoderndialog1.SelectedPath this leads to another q...
by v_2nas
Wed Nov 16, 2016 12:48 am
Forum: PowerShell GUIs
Topic: Referencing Variables across the events
Replies: 10
Views: 4531

Referencing Variables across the events

PowerShell Studio 2016 x64 Win 7 Pro SP 1 x64 Pardon my ignorance here as I am new to WFC, I wanted to know if variables can be called between the click events. Below are 2 click events from the powershell gui form. Now when I debug the script, i notice that $invoicepath and $AllBusinessPartners wou...
by v_2nas
Tue Nov 15, 2016 5:31 pm
Forum: PowerShell Studio
Topic: Cache files
Replies: 4
Views: 1449

Re: Cache files

Hi,

I managed to fix it. There was some issues with the foreach loop and i used subexpressions.