Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Powershell: How to pass 5 external string variables to a function that equates to 5 interal variables.

$
0
0

I'm trying to create a function that will need 5 string variables passed to it.  Those variables will be used for various cmdlets inside of the function.  I seem to be misunderstanding how to pass those to the function.  I've been going over the following articles and still am not quite getting it right:

http://technet.microsoft.com/en-us/library/hh847829.aspx

http://technet.microsoft.com/en-us/library/hh847806.aspx

http://technet.microsoft.com/en-us/library/hh847743.aspx

Basically, I want to schedule a task in taskscheduler to run a powershell script and pass the following variables to it:

$DPMServerName

$ProtectionGroupName

$RestoreSourceMachine

$RestoreDestinationMachine

$RestoreDestinationPath 

These variables would be used inside the function for various dpm cmdlet's.

Can I get a simple sample from someone that uses 5 separate external text string to be passed as 5 separate internal variables to a function?

 

 


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>