Syntax error in disable_shitty_service()

This commit is contained in:
Yorick Barbanneau 2018-02-22 14:57:42 +01:00
parent cca4844e6a
commit d89c1717c7

View file

@ -167,7 +167,8 @@ function remove_provisioned_shitty_modern_app {
Write-Host -ForegroundColor Green "done" Write-Host -ForegroundColor Green "done"
} }
function disable_shitty_service ([string]$name){ function disable_shitty_service {
param([string]$name)
Write-Host -NoNewline "`t$name : " Write-Host -NoNewline "`t$name : "
$serv = Get-Service -name $name $serv = Get-Service -name $name
if ( !$serv) { if ( !$serv) {
@ -178,7 +179,7 @@ function disable_shitty_service ([string]$name){
Write-Host -ForegroundColor Yellow "already disabled" Write-Host -ForegroundColor Yellow "already disabled"
} }
else { else {
service Stop-Service -InputObject $serv -PassThru | Set-Service -StartupType disabled Stop-Service -InputObject $serv -PassThru | Set-Service -StartupType disabled
Write-Host -ForegroundColor Green "done " Write-Host -ForegroundColor Green "done "
} }
} }