Compare commits

...

2 commits

2 changed files with 15 additions and 13 deletions

View file

@ -457,7 +457,14 @@ function DisableService {
}
Stop-Service -InputObject $service -PassThru | Set-Service -StartupType disabled
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
# Where user log-in.
AddRegKey @{
@ -467,11 +474,6 @@ 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)"

View file

@ -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
}
]
}