Search found 11558 matches

by jvierra
Wed Dec 13, 2017 1:37 pm
Forum: PowerShell GUIs
Topic: Borderless Form - how to move with Mouse1?
Replies: 2
Views: 53

Re: Borderless Form - how to move with Mouse1?

Here is some old code that does the moving. You can add it as a "snippet" and insert whenever needed. Add-Type @' using System; using System.ComponentModel; using System.Runtime.InteropServices; public class User32{ //const and dll functions for moving form public const int WM_NCLBUTTONDOWN = 0xA1; ...
by jvierra
Tue Dec 12, 2017 5:58 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

The following is the same as what I posted much earlier. Here it is with a simple example. # make an array of characters - an alphabet will do $a = [char]'A' .. [char]'Z' | ForEach-Object{ [char]$_ } # collect three at a time into strings for ($i = 0; $i -lt $a.Count; $i += 3) { $a[$i .. ($i + 2)] -...
by jvierra
Tue Dec 12, 2017 5:49 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

It sounds like you are asking a new question about how to work with arrays. It would have been best if you had opened a new question.

With arrays you can index through the array in sectiosn.

for($I = 0;$I -lt $count;$I+=3){

This will move you through the array 3 elements at a time.
by jvierra
Tue Dec 12, 2017 1:56 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

Sorry but I dont know how ConvertFrom-StringData is going to help me. If I am confusing you I am sorry. If you look at the code I am parsing an ini file by selecting on two strings Primary and Secondary. Then from there I am removing everything that is not needed. Then I am storing it in $collected...
by jvierra
Tue Dec 12, 2017 1:51 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

With an INI file you have two choices. You can use the INI API to read the INI sections into a data structure and then manipulate them or you can read the filter strings and convert them into data. If you want to invent some other method then you are on your own. The methods I posted work with all I...
by jvierra
Tue Dec 12, 2017 12:52 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

Sorry but I cannot keep up with your continuous changes of code and a questions. Everything you need is in my answers you just need to stop changing my code without understanding how it works or you must provide an accurate example of the text and a clear question. Using ConvertFrom-StringData will ...
by jvierra
Tue Dec 12, 2017 10:22 am
Forum: PowerShell GUIs
Topic: Text overwriting image in label control with image and text aligned middle left
Replies: 4
Views: 161

Re: Text overwriting image in label control with image and text aligned middle left

Can't be PSS. The settings are generated exactly like you do it in a hand coded form. Dump the PS1 and look at the code.

I suspect you have some odd setting that is not set as you expect.
by jvierra
Tue Dec 12, 2017 10:01 am
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

$i = 0
$a = 'one','two','three'
$a[$i..($i+2)] -join ' '
by jvierra
Mon Dec 11, 2017 5:28 am
Forum: Windows PowerShell
Topic: Trying to pass variables to a command line exe
Replies: 1
Views: 138

Re: Trying to pass variables to a command line exe

Invalid ID means that there is no file with that ID that is in the open state. Check the file ID exisits before trying to disconnect it.
by jvierra
Sat Dec 09, 2017 7:42 pm
Forum: Windows PowerShell
Topic: Parsing ini file and adding it to a CSV file
Replies: 14
Views: 371

Re: Parsing ini file and adding it to a CSV file

$txt = @' [Section_1] not need =1 Primary_need1=something1 Primary_need2=something2 Primary_need3=something3 Primary_Recovery_needed4=something4 Primary_Recovery_needed5=something5 Primary_Recovery_needed6=something6 not need =2 not need =3 '@ -split "`n" $data = $txt | Where-Object{ $_ -match 'Pri...