Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
ansible
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
OpenEdx
ansible
Commits
d5a0c181
Commit
d5a0c181
authored
Jul 10, 2014
by
Trond Hindenes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better result handling
parent
3bf16805
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
13 deletions
+21
-13
library/windows/win_feature.ps1
+21
-13
No files found.
library/windows/win_feature.ps1
View file @
d5a0c181
...
...
@@ -92,23 +92,31 @@ Elseif ($state -eq "absent") {
# Loop through results and create a hash containing details about
# each role/feature that is installed/removed
$installed_features
=
@
()
ForEach
(
$item
in
$featureresult
.FeatureResult
)
{
$installed_features
+
=
New-Object
psobject @
{
id
=
$item
.id.ToString
()
display_name
=
$item
.DisplayName
message
=
$item
.Message.ToString
()
restart_needed
=
$item
.RestartNeeded.ToString
()
skip_reason
=
$item
.SkipReason.ToString
()
success
=
$item
.Success.ToString
()
#$featureresult.featureresult is filled if anything was changed
if
(
$featureresult
.FeatureResult
)
{
ForEach
(
$item
in
$featureresult
.FeatureResult
)
{
$installed_features
+
=
New-Object
psobject @
{
id
=
$item
.id.ToString
()
display_name
=
$item
.DisplayName
message
=
$item
.Message.ToString
()
restart_needed
=
$item
.RestartNeeded.ToString
()
skip_reason
=
$item
.SkipReason.ToString
()
success
=
$item
.Success.ToString
()
}
}
Set
-Attr
$result
"feature_result"
$installed_features
$result
.changed
=
$true
}
Else
{
Set
-Attr
$result
"feature_result"
$null
}
Set
-Attr
$result
"feature_result"
$installed_features
Set
-Attr
$result
"feature_success"
$featureresult
.Success.ToString
()
Set
-Attr
$result
"feature_exitcode"
$featureresult
.ExitCode.ToString
()
Set
-Attr
$result
"feature_restart_needed"
$featureresult
.RestartNeeded.ToString
()
If
(
$result
.feature_result.Length -gt 0
)
{
$result
.changed
=
$true
}
Exit
-Json
$result
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment