Link to home
Start Free TrialLog in
Avatar of ITguy565
ITguy565Flag for United States of America

asked on

Powershell scripting Assistance : Multiple parameters which bring up a nested set of parameters.

Experts,

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
        }
}

Open in new window


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
Avatar of oBdA
oBdA

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITguy565

ASKER

Thanks for your assistance for the 2nd time today oBdA.

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.