Hi, I’m new to Pulumi and have a basic question. H...
# dotnet
h
Hi, I’m new to Pulumi and have a basic question. How would I convert the command
pulumi stacks ls
to C#?
I can use the API, but I’m guessing there’s a way to do this with the SDK
h
thanks!
To list stacks I’m able to do something like this
Copy code
var stackArgs = new InlineProgramArgs(projectName, stackName, program);
var stack = await LocalWorkspace.CreateOrSelectStackAsync(stackArgs);
var pulumistacks = stack.Workspace.ListStacksAsync().GetAwaiter().GetResult();
I’m trying to figure out a better way to set the project. I’d like to have a function that can list all stacks, without setting a stack itself.
Do you know if there’s a better way to do that?