Skip to content

Commit 0265317

Browse files
authored
Update Install service script.ps1
updated the install script to use parameters
1 parent 6d33c8f commit 0265317

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

Install service script.ps1

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1+
param (
2+
$BinPath = "C:\CommunicationDeviceSwitcherService",
3+
$Startup = "Automatic",
4+
$ExeName = "\CommunicationDeviceSwitcherService.exe"
5+
)
6+
17
$params = @{
28
Name = "CommunicationAudioAutoSwitchService"
3-
BinaryPathName = "C:\CommunicationDeviceSwitcherService\CommunicationDeviceSwitcherService.exe"
9+
BinaryPathName = "$BinPath$ExeName"
410
DisplayName = "Communication Audio Auto Switch Service"
511
StartupType = "Automatic"
612
Description = "This service automatically changes default communication output device, when the default playback device is changed"
713
}
814

9-
New-Service @params
15+
New-Service @params
16+
Start-Service $params.Name

0 commit comments

Comments
 (0)