I like to list all my contexts and switch to it from a command in my script, but it is interactively:
c:\\dist\\ranchercli\\rancher.exe context switch
NUMBER CLUSTER NAME PROJECT ID PROJECT NAME PROJECT DESCRIPTION
1 <all my projects listed>
2
3
4
:
Select a Project: (here I must enter a number, which is then saved to my cli2.json file)
my c:\.rancher\cli2.json only saves the active one,
If it is not active I get this error when accessing pods:
Error from server (Forbidden): pods is forbidden: User "u-vh3xagogyve" cannot list resource "pods" in API group ""
Nice it if was a direct ranchercli context set <project-id>