def add_capability(capability, source=None, limit_access=False, image=None, restart=False):
 if (salt.utils.version_cmp(__grains__['osversion'], '10') == (-1)):
  raise NotImplementedError('`install_capability` is not available on this version of Windows: {0}'.format(__grains__['osversion']))
 cmd = ['DISM', '/Quiet', ('/Image:{0}'.format(image) if image else '/Online'), '/Add-Capability', '/CapabilityName:{0}'.format(capability)]
 if source:
  cmd.append('/Source:{0}'.format(source))
 if limit_access:
  cmd.append('/LimitAccess')
 if (not restart):
  cmd.append('/NoRestart')
 return __salt__['cmd.run_all'](cmd)

def add_capability ( capability , source = None , limit_access = False , image = None , restart = False ) : if ( salt . utils . version_cmp ( __grains__ [ 'osversion' ] , '10' ) == ( - 1 ) ) : raise NotImplementedError ( '`install_capability` is not available on this version of Windows: {0}' . format ( __grains__ [ 'osversion' ] ) ) cmd = [ 'DISM' , '/Quiet' , ( '/Image:{0}' . format ( image ) if image else '/Online' ) , '/Add-Capability' , '/CapabilityName:{0}' . format ( capability ) ] if source : cmd . append ( '/Source:{0}' . format ( source ) ) if limit_access : cmd . append ( '/LimitAccess' ) if ( not restart ) : cmd . append ( '/NoRestart' ) return __salt__ [ 'cmd.run_all' ] ( cmd )
install a capability args: capability : the capability to install source : the optional source of the capability .