def remove_apppool(name):
 pscmd = []
 current_apppools = list_apppools()
 apppool_path = 'IIS:\\AppPools\\{0}'.format(name)
 if (name not in current_apppools):
  _LOG.debug('Application pool already absent: %s', name)
  return True
 pscmd.append("Remove-Item -Path '{0}' -Recurse".format(apppool_path))
 cmd_ret = _srvmgr(str().join(pscmd))
 if (cmd_ret['retcode'] == 0):
  _LOG.debug('Application pool removed successfully: %s', name)
  return True
 _LOG.error('Unable to remove application pool: %s', name)
 return False

def remove_apppool ( name ) : pscmd = [ ] current_apppools = list_apppools ( ) apppool_path = 'IIS:\\AppPools\\{0}' . format ( name ) if ( name not in current_apppools ) : _LOG . debug ( 'Application pool already absent: %s' , name ) return True pscmd . append ( "Remove-Item -Path '{0}' -Recurse" . format ( apppool_path ) ) cmd_ret = _srvmgr ( str ( ) . join ( pscmd ) ) if ( cmd_ret [ 'retcode' ] == 0 ) : _LOG . debug ( 'Application pool removed successfully: %s' , name ) return True _LOG . error ( 'Unable to remove application pool: %s' , name ) return False
remove an iis application pool .