Search found 12 matches

by azeiler
Thu Aug 08, 2019 7:52 am
Forum: Windows PowerShell
Topic: ArrayList of ArrayLists
Replies: 2
Views: 459

ArrayList of ArrayLists

I've got an ArrayList of ArrayLists of Strings that I need to process with an advanced function. I am modeling that function off of what I learned in "Learn Powershell Toolmaking in a Month of Lunches." In order to make the functions flexible, they tell you in that book to set it up so that a parame...
by azeiler
Thu May 09, 2019 2:34 pm
Forum: PowerShell Studio
Topic: Best Practice for Organizing a Project
Replies: 2
Views: 1021

Re: Best Practice for Organizing a Project

Thanks David, that is helpful. I'll be looking forward to your blog post if/when you get to it!
by azeiler
Thu May 09, 2019 12:34 pm
Forum: PowerShell Studio
Topic: Best Practice for Organizing a Project
Replies: 2
Views: 1021

Best Practice for Organizing a Project

Product, version and build: Powershell Studio 2019 version 5.6.160 32 or 64 bit version of product: 64 bit Operating system: Windows Server 2016 Standard 32 or 64 bit OS: 64 bit ******************************************************************************************************** I'm looking for g...
by azeiler
Mon May 06, 2019 10:56 am
Forum: Windows PowerShell
Topic: Reading Specific Lines from a Text File
Replies: 1
Views: 727

Reading Specific Lines from a Text File

Is there a very efficient way to read specific lines from a text file? Say I wanted to read lines 54 through 78 of a text file, what would the most efficient way to do that be? Get-Content seems to be extremely inefficient with large files. Elsewhere I've seen suggestions like: Get-Content "file.txt...
by azeiler
Mon May 06, 2019 10:49 am
Forum: Windows PowerShell
Topic: Passing Objects between functions and Export-CSV
Replies: 7
Views: 1159

Re: Passing Objects between functions and Export-CSV

I was able to fix this issue, though I'm not entirely sure I understand. Your suggestions seem to be related. XClass contains a method which sets one of it's parameters. I originally had the method returning that parameter as well, thinking there might be cases where I want to save the parameter and...
by azeiler
Fri May 03, 2019 9:54 am
Forum: Windows PowerShell
Topic: Passing Objects between functions and Export-CSV
Replies: 7
Views: 1159

Re: Passing Objects between functions and Export-CSV

We need real code and not pseudo code. It should be attached here as a PS1 file that runs and demonstrates th issue you are having. As posted the code is not useable. The code is full of syntax errors. It's full of syntax errors because I removed code that I am not allowed to post on the internet. ...
by azeiler
Fri May 03, 2019 8:37 am
Forum: Windows PowerShell
Topic: Passing Objects between functions and Export-CSV
Replies: 7
Views: 1159

Re: Passing Objects between functions and Export-CSV

Here is the function, amended for propriety sake. It takes an array which is basically each line of a block of text, extracts information from the text, and sets that information to the properties of a new object of type ZClass. When I use this same basic code in my script without making it a separa...
by azeiler
Fri May 03, 2019 6:26 am
Forum: Windows PowerShell
Topic: Passing Objects between functions and Export-CSV
Replies: 7
Views: 1159

Passing Objects between functions and Export-CSV

I have been getting into the object oriented nature of Powershell recently, and ran into an issue. I have created a custom class and wrote a script that instantiates that class and populates its properties. It will then do that a number of times based on elements in an array. Lastly, I used Export-C...
by azeiler
Wed Jan 02, 2019 2:22 pm
Forum: PowerShell Studio
Topic: Builds Compatible with Multiple Versions of Powershell?
Replies: 1
Views: 597

Builds Compatible with Multiple Versions of Powershell?

Is there a way to build an executable that works for multiple versions of Powershell? When I check out the Package options, it only allows me to select one (see attached picture). One option would be to use the lowest version-- v2 build seems to work on v5 for example. But I'm worried that there wil...
by azeiler
Tue Nov 27, 2018 9:37 am
Forum: PowerShell Studio
Topic: Including/referencing a CSV file in a Multi-form Project
Replies: 3
Views: 758

Re: Including/referencing a CSV file in a Multi-form Project

Thanks for the quick reply.

So it doesn't make sense to actually add the CSV file to the Powershell project?

If I use the MSI Installer method, how do I reference the CSV from inside the script? Would I look for a file with the correct name in Current Directory?