The use case is that we have to perform a Pulumi deployment from outside the csproj
folder. So I am doing this in a PowerShell
script:
$csprojFolder = "./pathtocsproj"
pulumi stack select $stackName --secrets-provider=$keyVaultURL --create --cwd $csprojFolder
pulumi config set Resources:Setting1 $value1 --cwd $csprojFolder
pulumi config set Resources:Setting2 $value2 --cwd $csprojFolder
pulumi preview --stack $stackName --diff --cwd $csprojFolder
pulumi up --stack $stackName --cwd $csprojFolder
Is there a better way to do this? So that we can set the working directory for Pulumi once, instead of having to repeat the $csprojFolder
variable for every call to Pulumi.