Author Posts

April 19, 2016 at 6:07 am

I watched and enjoyed Don's 3 videos on toolmaking. Don refers to a 'controller script'. Would this be a script that calls a bunch of functions ?

April 19, 2016 at 6:33 am

It would be indeed.

April 19, 2016 at 9:57 am

Awesome, thanks Don !

May 13, 2016 at 8:48 am

any good examples out there in the wild to reference. I know there are bunch of different ways to collect inputs and start calling functions just curious to see preferences/examples of how MVPs like yourself do it.

November 10, 2016 at 12:26 pm

Yeah, me too. It's a clear way forward, but I'm not sure how to go about it...

November 10, 2016 at 1:44 pm

dont think i have came across those vids, could you share a link(s)

November 15, 2016 at 3:41 pm

Nick

I'm not saying this is the BEST way of doing it, but it works, and seems reasonably elegant to me (with much credit to members of the Powershell forum in the Spiceworks community, particularly tfl):

Do
{
    $FirstName = .\Get-UserFirstName.ps1
} Until ($FirstName)

Do
{
    $LastName = .\Get-UserLastName.ps1
} Until ($LastName)

$Title="Enter Telephone Extension Number"
Do
{
    $Extension = .\Get-UserExtension.ps1 -verbose -Title $Title
} Until ($Extension)

Write-Output "Child scriptS gave me '$FirstName' and '$LastName', and extension number '$Extension'"

And here's the first script, Get-UserFirstName.ps1:

Function Get-UserFirstName
{
$FirstName = Read-Host -Prompt "First Name"

return $FirstName
}

Get-UserFirstName