Fail-Json-obj$result-message"Failed to add new attribute to Web App Pool $name. Attribute: $attribute_key, Value: $value, Exception: $($_.Exception.Message)"
Fail-Json-obj$result-message"Failed to add new attribute to Web App Pool $name. Attribute: $attribute_key, Value: $value, Exception: $($_.Exception.Message)"
}
}
@ -260,7 +260,7 @@ if ($state -eq "absent") {
if($state-eq"started"-or$state-eq"restarted"){
if($state-eq"started"-or$state-eq"restarted"){
if(-not$check_mode){
if(-not$check_mode){
try{
try{
Start-WebAppPool-Name$name
Start-WebAppPool-Name$name>$null
}catch{
}catch{
Fail-Json$result"Failed to start Web App Pool $($name): $($_.Exception.Message)"
Fail-Json$result"Failed to start Web App Pool $($name): $($_.Exception.Message)"
}
}
@ -271,7 +271,7 @@ if ($state -eq "absent") {
if($state-eq"stopped"){
if($state-eq"stopped"){
if(-not$check_mode){
if(-not$check_mode){
try{
try{
Stop-WebAppPool-Name$name
Stop-WebAppPool-Name$name>$null
}catch{
}catch{
Fail-Json$result"Failed to stop Web App Pool $($name): $($_.Exception.Message)"
Fail-Json$result"Failed to stop Web App Pool $($name): $($_.Exception.Message)"
}
}
@ -280,7 +280,7 @@ if ($state -eq "absent") {
}elseif($state-eq"restarted"){
}elseif($state-eq"restarted"){
if(-not$check_mode){
if(-not$check_mode){
try{
try{
Restart-WebAppPool-Name$name
Restart-WebAppPool-Name$name>$null
}catch{
}catch{
Fail-Json$result"Failed to restart Web App Pool $($name): $($_.Exception.Message)"
Fail-Json$result"Failed to restart Web App Pool $($name): $($_.Exception.Message)"