This project is read-only.

The best and legal way to get current directory within SPSD?

Sep 13, 2013 at 3:14 AM
Hello team,

Just wonder what might be the best and "legal" way to obtain the current directory with in SPSP script/custom targets?

I use [Environment]::CurrentDirectory right now, seems to be okay.
Just wonder how legal it is, might it have any drawback or something?

Sep 13, 2013 at 8:10 AM
Edited Sep 13, 2013 at 8:16 AM
Legal is everything you want as long as you don't blame me if I break it in the next release ;)

Anyhow, you could also use one of these which are already available in SPSD :)
$baseDir  # this is where the batches are (root of SPSD package)
$envDir # this is where the environment files are
$logDir # this is where the log files will go
$scriptDir # this is where all scripts (including CustomTargets.ps1) are
$solDir # this is where all WSPs are placed (it can be also outside of SPSD if a different location is passed to the SPSD parameter $solutionDirectory)
Sep 13, 2013 at 8:14 AM
I will :)

Ohhh, these vars look AWESOME. Have no idea why I missed them.
Many thanks!
Sep 13, 2013 at 8:18 AM
Let's see if I can keep up staying ahead of you ;)
Sep 13, 2013 at 8:20 AM
Edited Sep 13, 2013 at 8:20 AM
Keep dreaming, keep dreaming.
Anyway, don't fight the enemy; hire the enemy; it is worth several "friends" :)
Sep 13, 2013 at 8:50 AM
Hehe, will keep that in mind :)