def remove_site(name):
 pscmd = []
 current_sites = list_sites()
 if (name not in current_sites):
  _LOG.debug('Site already absent: %s', name)
  return True
 pscmd.append("Remove-WebSite -Name '{0}'".format(name))
 cmd_ret = _srvmgr(str().join(pscmd))
 if (cmd_ret['retcode'] == 0):
  _LOG.debug('Site removed successfully: %s', name)
  return True
 _LOG.error('Unable to remove site: %s', name)
 return False

def remove_site ( name ) : pscmd = [ ] current_sites = list_sites ( ) if ( name not in current_sites ) : _LOG . debug ( 'Site already absent: %s' , name ) return True pscmd . append ( "Remove-WebSite -Name '{0}'" . format ( name ) ) cmd_ret = _srvmgr ( str ( ) . join ( pscmd ) ) if ( cmd_ret [ 'retcode' ] == 0 ) : _LOG . debug ( 'Site removed successfully: %s' , name ) return True _LOG . error ( 'Unable to remove site: %s' , name ) return False
delete a website from iis .