Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
auto-tx
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
vamp
auto-tx
Compare revisions
c280c223c60ea649676c59c3f72e48e61298567f to aedeba84c0961ab315edd5c6f56f57886c058ddd
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
vamp/auto-tx
Select target project
No results found
aedeba84c0961ab315edd5c6f56f57886c058ddd
Select Git revision
Branches
auto-deploy
bug-cpuload
feature/cmdline-storage-status
feature/tray/logwindow
master
server2012
update-docs
Tags
1.0
1.1
1.2
1.3
1.4
2.0
2.1
3.0
autotransfer-v1
16 results
Swap
Target
vamp/auto-tx
Select target project
vamp/auto-tx
1 result
c280c223c60ea649676c59c3f72e48e61298567f
Select Git revision
Branches
auto-deploy
bug-cpuload
feature/cmdline-storage-status
feature/tray/logwindow
master
server2012
update-docs
Tags
1.0
1.1
1.2
1.3
1.4
2.0
2.1
3.0
autotransfer-v1
16 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Fix encoding
· 3bc4af97
Niko Ehrenfeuchter
authored
2 years ago
3bc4af97
Automatic formatting
· aedeba84
Niko Ehrenfeuchter
authored
2 years ago
aedeba84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Scripts/Install-Service.ps1
+9
-13
9 additions, 13 deletions
Scripts/Install-Service.ps1
with
9 additions
and
13 deletions
Scripts/Install-Service.ps1
View file @
aedeba84
...
...
@@ -10,7 +10,7 @@
[
CmdletBinding
()]
Param
(
[
Parameter
(
Mandatory
=
$False
)][
switch
]
$StartService
[
Parameter
(
Mandatory
=
$False
)][
switch
]
$StartService
)
function
Start-MyService
{
...
...
@@ -18,8 +18,7 @@ function Start-MyService {
try
{
Start-Service
$ServiceName
Write-Host
"[OK]"
-Fore
Green
}
catch
{
}
catch
{
$ex
=
$_
.
Exception
Write-Host
"[FAILED]"
-Fore
Red
Write-Host
$ex
.
Message
...
...
@@ -43,10 +42,9 @@ function Copy-ServiceFiles {
Copy-Item
-Recurse
-Force
-Path
"
$ServiceName
\*"
-Destination
$ServiceDir
Copy-Item
-Recurse
-Force
-Path
"conf-example"
-Destination
$ServiceDir
# create a dummy log file, so admins can already start watching it:
Out-File
-FilePath
$ServiceLog
-InputObject
"
$(
$ServiceName
)
installed"
Out-File
-FilePath
$ServiceLog
-InputObject
"
$(
$ServiceName
)
installed"
-Encoding
utf8
Write-Host
"[OK]"
-Fore
Green
}
catch
{
}
catch
{
$ex
=
$_
.
Exception
Write-Host
"[FAILED]"
-Fore
Red
Write-Host
$ex
.
Message
...
...
@@ -73,15 +71,13 @@ function Add-PerfMonGroupMember {
try
{
Add-LocalGroupMember
-Group
$GroupName
-Member
$ServiceUser
Write-Host
$
(
"Successfully added user [
$(
$ServiceUser
)
] to the local"
"group [
$(
$GroupName
)
]."
)
}
catch
[
Microsoft.PowerShell.Commands.MemberExistsException
]
{
"group [
$(
$GroupName
)
]."
)
}
catch
[
Microsoft.PowerShell.Commands.MemberExistsException
]
{
Write-Host
$
(
"User [
$(
$ServiceUser
)
] is already a member of the local"
"group [
$(
$GroupName
)
], no action required."
)
}
catch
{
"group [
$(
$GroupName
)
], no action required."
)
}
catch
{
Write-Host
$
(
"Adding user [
$(
$ServiceUser
)
] to the local group"
"[
$(
$GroupName
)
] failed:
$(
$_
.
Exception
.
Message
)
"
)
"[
$(
$GroupName
)
] failed:
$(
$_
.
Exception
.
Message
)
"
)
}
}
...
...
This diff is collapsed.
Click to expand it.