I'm kinda new to Power-Shell and my previous scripting experience was DOS Batch as well as a little Perl several years ago, but in both cases most of my scripts were at the largest about 100 lines so I never bothered much with Functions. I am now attempting to write a very large script and wanted to keep it organized by using Functions, but I'm having issues...
Can somebody explain to me how to make variables work between functions and the root level of the script in a powershell script? For example, why doesn't this work:
$fname = (Read-Host "First Name")
$lname = (Read-Host "Last Name")
$mi = (Read-Host "Middle Initial")
$job = (Read-Host "Job Title")
$dept = (Read-Host "Department")