Join two variables together with powershell

Hi, Here I will explain two ways I've found to concatenate two variables to a path.I have at multiple occasions had the need to use two variables to form a single path based on input from the command line. This is an example on how to change location using two variables. This doesn't work. $Drive = "D:" $Directory = "Directory" Set-Location $Drive$Directory The reason this doesn't work is that Set-Location accepts $Drive as the entire path and considers $Directory to be a new command. There are two ways to solve this. The first was is to create a third variable…

0 Comments