File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed
Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -18,15 +18,21 @@ from vsts.vss_connection import VssConnection
1818from msrest.authentication import BasicAuthentication
1919import pprint
2020
21- token= ' REDACTED'
22- team_instance= ' https://REDACTED.visualstudio.com'
21+ # Fill in with your personal access token and org URL
22+ personal_access_token = ' YOURPAT'
23+ organization_url = ' https://dev.azure.com/YOURORG'
2324
24- credentials = BasicAuthentication(' ' , token)
25- connection = VssConnection(base_url = team_instance, creds = credentials)
25+ # Create a connection to the org
26+ credentials = BasicAuthentication(' ' , personal_access_token)
27+ connection = VssConnection(base_url = organization_url, creds = credentials)
28+
29+ # Get a client (the "core" client provides access to projects, teams, etc)
2630core_client = connection.get_client(' vsts.core.v4_0.core_client.CoreClient' )
2731
28- team_projects = core_client.get_projects()
32+ # Get the list of projects in the org
33+ projects = core_client.get_projects()
2934
35+ # Show details about each project in the console
3036for project in team_projects:
3137 pprint.pprint(project.__dict__ )
3238```
You can’t perform that action at this time.
0 commit comments