10th January 2008, 10:55 am
I've written a few posts and a couple of tutorials that discuss connecting to remote machines. For example:
In each of these articles an array is used to connect to multiple remote computers. The procedure consists of placing computer names in a text file which is then read by the "Get-Content" cmdlet which creates the array.
I've received comments and emails asking how to query Active Directory for all the computer accounts. Well, here is how we do that…
Continue reading ‘How to retrieve a list of Computer Accounts from Active Directory’ »
9th January 2008, 11:59 am
DR. Tom Moreau posed the following question, "Is there a way to call a function that resides in a separate script, along the lines of Perl’s use statement? I don’t want to have to load each function script manually into the current PS session."
I said sure, take a look at my article on organizing script code and calling functions using dot sourcing.
Tom's response, "That’s close to what I’d like. Ideally, I’d like to refer to the script name just once and then refer to the functions therein as required. I’m wondering what to do if I have a .PS1 script that contains multiple functions and I want to execute a specific function within that PS1 script."
What a great idea. To have a PowerShell script that contains multiple functions in which specific functions could be called from other scripts. How do we do this?
Continue reading ‘Why would I want to call a function that exists in a separate script?’ »