ITguy565
asked on
Powershell scripting Assistance : Multiple parameters which bring up a nested set of parameters.
Experts,
I have the following code fragment :
I would like to modify this where I can add Nested Parameter Sets.
For instance in this code I would use something like :
test-filelocation -fullpath "c:\test\somefile.txt"
or
in the same code I could use something like this
test-filelocation -location "c:\test" -filename "somefile.txt"
I have the following code fragment :
Function Test-FileLocation($location, $FileName){
write-host "Starting File Check for $("$location\$filename")"
if ($("$location\$filename")){
write-host "File Exists Proceeding with script"
$filetest = "True"
}else {
write-host "File Does not Exist : FileTest Failed"
Exit
}
}
I would like to modify this where I can add Nested Parameter Sets.
For instance in this code I would use something like :
test-filelocation -fullpath "c:\test\somefile.txt"
or
in the same code I could use something like this
test-filelocation -location "c:\test" -filename "somefile.txt"
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
This is one area that I haven't explored to this point with powershell script creation. I will definitely need to look into it more.