-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconditionScript.ps1
More file actions
25 lines (22 loc) · 891 Bytes
/
conditionScript.ps1
File metadata and controls
25 lines (22 loc) · 891 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
$response = @{
State = 'NotSupported';
Message = 'Not executed';
Properties = @{ Name = 'HasMultipleAltazionConfig'; Value = $false; Type = 'boolean' },
@{ Name = 'KoostodesServiceName'; Value = ''; Type = 'string' };
};
$folder = Get-Item $Env:PROGRAMDATA'\Cpoint\``[e``]' -ErrorAction SilentlyContinue;
if($folder -ne $null) {
$parent = $folder.Parent;
$multi = Get-Content ($parent.FullName + '\current.config') -ErrorAction SilentlyContinue
if($multi -ne $null) { $response.Properties[0].Value = $true; }
$svc = Get-Service emainsrv -ErrorAction SilentlyContinue;
if($svc -eq $null) {
$svc = Get-Service altazionkoostodes -ErrorAction SilentlyContinue;
}
if($svc -ne $null) {
$response.Properties[0].Value = $svc.Name;
}
$response.State = 'Available';
$response.Message = 'Dossier trouvé.';
};
$response