Compare commits

..

No commits in common. "068e82ef2821cb4f9bdf29e354df6638e697948e" and "745049551a4409ad7375a0fdfcb58262e831d0d3" have entirely different histories.

2 changed files with 13 additions and 15 deletions

View file

@ -457,14 +457,7 @@ function DisableService {
} }
Stop-Service -InputObject $service -PassThru | Set-Service -StartupType disabled Stop-Service -InputObject $service -PassThru | Set-Service -StartupType disabled
Write-Host -ForegroundColor Green "done" Write-Host -ForegroundColor Green "done"
} if ( $params.userService ) {
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 ) {
# For this kind of service, we need to add a key t create a user service # For this kind of service, we need to add a key t create a user service
# Where user log-in. # Where user log-in.
AddRegKey @{ 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 { else {
Write-Host -ForegroundColor Red "`tError : No name or file for action $($MyInvocation.MyCommand.Name)" Write-Host -ForegroundColor Red "`tError : No name or file for action $($MyInvocation.MyCommand.Name)"

View file

@ -7,43 +7,43 @@
"_comment" : "Disable sync service (useful for calendars, contact, mesaging and other sync applications)", "_comment" : "Disable sync service (useful for calendars, contact, mesaging and other sync applications)",
"action" : "DisableService", "action" : "DisableService",
"name" : "OneSyncSvc", "name" : "OneSyncSvc",
"userService" : true "userService" : "True"
}, },
{ {
"_comment" : "Disable connected user platform service", "_comment" : "Disable connected user platform service",
"action" : "DisableService", "action" : "DisableService",
"name" : "CDPUserSvc", "name" : "CDPUserSvc",
"userService" : true "userService" : "True"
}, },
{ {
"_comment" : "Disable messaging service", "_comment" : "Disable messaging service",
"action" : "DisableService", "action" : "DisableService",
"name" : "MessagingService", "name" : "MessagingService",
"userService" : true "userService" : "True"
}, },
{ {
"_comment" : "Disable contact data service", "_comment" : "Disable contact data service",
"action" : "DisableService", "action" : "DisableService",
"name" : "PimIndexMaintenanceSvc", "name" : "PimIndexMaintenanceSvc",
"userService" : true "userService" : "True"
}, },
{ {
"_comment" : "Disable contact data service", "_comment" : "Disable contact data service",
"action" : "DisableService", "action" : "DisableService",
"name" : "UnistoreSvc", "name" : "UnistoreSvc",
"userService" : true "userService" : "True"
}, },
{ {
"_comment" : "Disable user data sharing service", "_comment" : "Disable user data sharing service",
"action" : "DisableService", "action" : "DisableService",
"name" : "UserDataSvc", "name" : "UserDataSvc",
"userService" : true "userService" : "True"
}, },
{ {
"_comment" : "Disable contact data service", "_comment" : "Disable contact data service",
"action" : "DisableService", "action" : "DisableService",
"name" : "WpnUserService", "name" : "WpnUserService",
"userService" : true "userService" : "True"
} }
] ]
} }