7
7
param (
8
8
[string ] [Parameter (Mandatory = $false )] $csvPath = " C:\Users\audun\Downloads\ghas_active_committers_miljodir_2025-01-31T0015.csv" ,
9
9
[string ] [Parameter (Mandatory = $false )] $csvPath2 = " C:\Users\audun\Downloads\export-miljodir-1738311321.csv" ,
10
- [string ] [Parameter (Mandatory = $false )] $copilotCsvPath = " C:\Users\audun\Downloads\miljodir-seat-usage-1738311386.csv"
10
+ [string ] [Parameter (Mandatory = $false )] $copilotCsvPath = " C:\Users\audun\Downloads\miljodir-seat-usage-1738311386.csv" ,
11
+ [string ] [Parameter (Mandatory = $false )] $workspaceId = " xxxx"
12
+
11
13
)
12
14
13
15
$csv = import-csv - Path $csvPath
@@ -34,13 +36,6 @@ $copilotUsedByOtherOrgsOnly = $copilotCsv | Where-Object { -not ($userLogins -co
34
36
# Output users which are using copilot but seemingly not pushing code to the org
35
37
$copilotUsedByOtherOrgsOnly
36
38
37
- # Output the missing entries
38
- Write-Host " Found $ ( $nonPushingMembers.Count ) members which have not pushed code in the last 3 months."
39
- $nonPushingMembers | select " GitHub com login" , " GitHub com saml name" , " Github com name"
40
- # Output the result
41
- # Write-Host "$($latestPerUser.Count) users found commiting code in the last 3 months."
42
- # $latestPerUser | Select-Object 'User login', 'Organization / repository', 'Last pushed date', 'Last pushed email' | Sort-Object 'Last pushed date' | Format-Table -AutoSize
43
-
44
39
# Successful Github Logins
45
40
$githubLoginQuery = @"
46
41
SigninLogs
@@ -52,15 +47,20 @@ SigninLogs
52
47
| project UserPrincipalName
53
48
"@
54
49
55
- # Define the workspace and resource group
56
- $workspaceId = " xxx"
57
-
58
50
# Execute the query
51
+ $allGithubUsers = $usersCsv | select - ExpandProperty " GitHub com saml name"
59
52
$githubLoginsList = (Invoke-AzOperationalInsightsQuery - WorkspaceId $workspaceId - Query $githubLoginQuery ).Results | Select-Object - ExpandProperty UserPrincipalName
60
- $nonPushingNamesList = $nonPushingMembers | Select-Object - ExpandProperty ' GitHub com saml name'
61
53
62
- $missingNames = $nonPushingNamesList | Where-Object { -not ($githubLoginsList -contains $_ ) }
54
+ $missingNames = $allGithubUsers | Where-Object { -not ($githubLoginsList -contains $_ ) }
63
55
64
56
# Output the missing names
65
- Write-Host " The following names have not signed in to Github for at least the past 5 months" - ForegroundColor Red
66
- $missingNames | ForEach-Object { Write-Host $_ }
57
+ Write-Host " The following names have not signed in to the Github org for at least the past 5 months" - ForegroundColor Red
58
+ Write-Host " Note that some users may have signed in to other orgs under the enterprise, and are still requiring a license." - ForegroundColor Yellow
59
+ $missingNames | ForEach-Object { Write-Host $_ }
60
+
61
+ # Output the missing entries
62
+ Write-Host " Found $ ( $nonPushingMembers.Count ) members which have not pushed code in the last 3 months."
63
+ $nonPushingMembers | select " GitHub com login" , " GitHub com saml name" , " Github com name"
64
+ # Output the result
65
+ Write-Host " $ ( $latestPerUser.Count ) users found commiting code in the last 3 months."
66
+ $latestPerUser | Select-Object ' User login' , ' Organization / repository' , ' Last pushed date' , ' Last pushed email' | Sort-Object ' Last pushed date' | Format-Table - AutoSize
0 commit comments