|
|
@@ -13,8 +13,8 @@ $GITLAB_INVITE = "$PSScriptRoot\gitlab-invite.ps1"
|
|
|
Set-Log ([IO.Path]::GetFullPath("$PSScriptRoot\..\runtime\groupusers-${env:computername}.log")) 1mb 2
|
|
|
|
|
|
|
|
|
-foreach ($module in @("ActiveDirectory")){
|
|
|
- if (-not (Get-Module $module -All)) {
|
|
|
+foreach ($module in @("ActiveDirectory", "Powershell-Yaml")){
|
|
|
+ if (-not (Get-Module -ListAvailable -Name $module)) {
|
|
|
Install-Module $module -Scope CurrentUser
|
|
|
}
|
|
|
if (-not (Get-Module $module)) {
|
|
|
@@ -22,28 +22,13 @@ foreach ($module in @("ActiveDirectory")){
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-$departments = @(
|
|
|
- @{
|
|
|
- name="ANNAX CH Testing and Integration"
|
|
|
- id=3160
|
|
|
- glgroup=@{
|
|
|
- name="annax/teams/integrationtest";
|
|
|
- access_level="20";
|
|
|
- }
|
|
|
- },
|
|
|
- @{
|
|
|
- name="ANNAX DE Device Software Engineering"
|
|
|
- id=3130
|
|
|
- glgroup=@{
|
|
|
- name="annax/teams/developers";
|
|
|
- access_level="30";
|
|
|
- }
|
|
|
- }
|
|
|
-)
|
|
|
+$dp_file = [IO.Path]::GetFullPath("$PSScriptRoot\..\etc\departments.yaml")
|
|
|
+
|
|
|
+$deps=Get-Content $dp_file | ConvertFrom-Yaml
|
|
|
|
|
|
function Main(){
|
|
|
|
|
|
- $departments | ForEach-Object {
|
|
|
+ $deps.departments | ForEach-Object {
|
|
|
$filter = "*($([string]$_.id))"
|
|
|
$department = $_;
|
|
|
|