mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add comments
This commit is contained in:
parent
10a526e020
commit
bceaf96fd6
2 changed files with 12 additions and 5 deletions
|
@ -78,6 +78,6 @@ else
|
||||||
}
|
}
|
||||||
|
|
||||||
$FileName = $DownLoadUrl.Split('/')[-1]
|
$FileName = $DownLoadUrl.Split('/')[-1]
|
||||||
download-file $downloadurl "$powershellpath\$filename"
|
# download-file $downloadurl "$powershellpath\$filename"
|
||||||
|
|
||||||
."$powershellpath\$filename" /quiet /log "C:\powershell\install.log"
|
."$powershellpath\$filename" /quiet /log "C:\powershell\install.log"
|
||||||
|
|
|
@ -63,16 +63,23 @@ If ($state -eq "present") {
|
||||||
}
|
}
|
||||||
Elseif ($state -eq "absent") {
|
Elseif ($state -eq "absent") {
|
||||||
try {
|
try {
|
||||||
$result = Remove-WindowsFeature -Name $name
|
if ($restart) {
|
||||||
|
$featureresult = Remove-WindowsFeature -Name $name -Restart
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$featureresult = Remove-WindowsFeature -Name $name
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
Fail-Json $result $_.Exception.Message
|
Fail-Json $result $_.Exception.Message
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$feature_results = @()
|
# Loop through results and create a hash containing details about
|
||||||
ForEach ($item in $result.FeatureResult) {
|
# each role/feature that is installed/removed
|
||||||
$feature_results += New-Object psobject @{
|
$installed_features = @()
|
||||||
|
ForEach ($item in $featureresult.FeatureResult) {
|
||||||
|
$installed_features += New-Object psobject @{
|
||||||
id = $item.id.ToString()
|
id = $item.id.ToString()
|
||||||
display_name = $item.DisplayName
|
display_name = $item.DisplayName
|
||||||
message = $item.Message.ToString()
|
message = $item.Message.ToString()
|
||||||
|
|
Loading…
Reference in a new issue