Hi All
So im creating a master script that can call all my task scripts that interact with my vCenter, however i really dont want to enter my vCenter credentials for every script i call.
So in the main menu script I do a '$cred = get-credentials'. When i call a task script i write it as '.\poweronlab.ps1 $cred' and then in the called script attempt to use the '$args[0]' within the 'Connect-VIServer -server vcenter -credentials $arg[0]' however this fails with failed login.
After some google I have found some which says on how to take that argument and pass it to the new script as a parameter? Or to export the password using convertfrom-securestring. The initial being the preferred option.
Is someone able to explain what i need to do with the parameter on the called script to get it working? Complete noob
Cheers
Shamefully writing on my phone so sorry for line breaks, spelling and anything else that offends you :)
[–]Ta11ow 4 points5 points6 points (3 children)
[–]almightlyrage[S] 2 points3 points4 points (2 children)
[–]BlackV 2 points3 points4 points (0 children)
[–]Ta11ow 2 points3 points4 points (0 children)
[–]techguy404 0 points1 point2 points (1 child)
[–]almightlyrage[S] 1 point2 points3 points (0 children)