Thank you for the answers. Once I read them, it started me thinking about other possibilities of how to handle this. It looks like one of them is so simple, that I didn't think it would work:
Alternate Solution - Seems to work fine
1. Open PowerCLI command prompt.
2. Connect to the VI server using Connect-VIServer, and enter credentials when prompted.
3. Run a powershell script from within a script - for example:
Report1.ps1
Report2.ps1
Where Report1.ps1 and Report2.ps1 contain PowerCLI commands but do not have any Connect-VIServer commands, since it assumes the connection is already established.
4. Execute Call_Report_Scripts.ps1 from the current PowerCLI command prompt.
5. The scripts execute from within a script without prompting. Progress bars are visible also.
I've tried it and it seems to work fine. Now, I'm wondering is this supported? Can you call a Powershell script from within a Powershell script without unexpected consequences? Will this support be deprecated at some point? Is this the correct way to call a script from within a script?
Finally, another possible solution, which I have not tried, and which seems overly complex and prone to errors, is to call a Powershell script from a batch file passing arguments within the batch file. I only list it here in case this line of thought would be useful. The arguments within the batch file could then be passed to Powershell such as the following - which will not work as written - it would have to be modified to call the PowerCLI environment and extensions instead of a standard Powershell session, and that is another problem with this approach:
powershell -command "&C:\Scripts\Report1.ps1 %1 %2"
The batch file Call_Report_Scripts.bat could be called as follows
Call_Report_Scripts.bat
Then the individual Powershell scripts could be modified to include the paramaters passed to the batch file to be passed as arguments as follows
Connect-VIServer -server $args[0] -password $args[1]
...do stuff...
Cheers,
Ed Z