mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add restart functionality
This commit is contained in:
parent
ab8f7289b0
commit
10a526e020
1 changed files with 6 additions and 1 deletions
|
@ -50,7 +50,12 @@ If ($params.restart) {
|
||||||
|
|
||||||
If ($state -eq "present") {
|
If ($state -eq "present") {
|
||||||
try {
|
try {
|
||||||
$result = Add-WindowsFeature -Name $name
|
if ($restart) {
|
||||||
|
$featureresult = Add-WindowsFeature -Name $name -Restart
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$featureresult = Add-WindowsFeature -Name $name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Fail-Json $result $_.Exception.Message
|
Fail-Json $result $_.Exception.Message
|
||||||
|
|
Loading…
Add table
Reference in a new issue