diff --git a/cleanW10.ps1 b/cleanW10.ps1 index aa8a212..b2eb039 100755 --- a/cleanW10.ps1 +++ b/cleanW10.ps1 @@ -457,14 +457,7 @@ function DisableService { } Stop-Service -InputObject $service -PassThru | Set-Service -StartupType disabled Write-Host -ForegroundColor Green "done" - } - catch { - Write-Host -NoNewLine -ForegroundColor Red "`tError`n`t" - write-Host -ForegroundColor DarkRed $Error[0].Exception.Message - } - finally { - Write-host "Value : $($params.userService.getType())" - if ( $params.ContainsKey('userService') -and $params.userService -eq $true ) { + if ( $params.userService ) { # For this kind of service, we need to add a key t create a user service # Where user log-in. AddRegKey @{ @@ -474,6 +467,11 @@ function DisableService { } } } + catch { + Write-Host -NoNewLine -ForegroundColor Red "`tError`n`t" + write-Host -ForegroundColor DarkRed $Error[0].Exception.Message + return + } } else { Write-Host -ForegroundColor Red "`tError : No name or file for action $($MyInvocation.MyCommand.Name)" diff --git a/modules.d/SER_Users.conf b/modules.d/SER_Users.conf index 9a14348..d402b34 100644 --- a/modules.d/SER_Users.conf +++ b/modules.d/SER_Users.conf @@ -7,43 +7,43 @@ "_comment" : "Disable sync service (useful for calendars, contact, mesaging and other sync applications)", "action" : "DisableService", "name" : "OneSyncSvc", - "userService" : true + "userService" : "True" }, { "_comment" : "Disable connected user platform service", "action" : "DisableService", "name" : "CDPUserSvc", - "userService" : true + "userService" : "True" }, { "_comment" : "Disable messaging service", "action" : "DisableService", "name" : "MessagingService", - "userService" : true + "userService" : "True" }, { "_comment" : "Disable contact data service", "action" : "DisableService", "name" : "PimIndexMaintenanceSvc", - "userService" : true + "userService" : "True" }, { "_comment" : "Disable contact data service", "action" : "DisableService", "name" : "UnistoreSvc", - "userService" : true + "userService" : "True" }, { "_comment" : "Disable user data sharing service", "action" : "DisableService", "name" : "UserDataSvc", - "userService" : true + "userService" : "True" }, { "_comment" : "Disable contact data service", "action" : "DisableService", "name" : "WpnUserService", - "userService" : true + "userService" : "True" } ] }