def package_info(package, image=None):
 cmd = ['DISM', '/English', ('/Image:{0}'.format(image) if image else '/Online'), '/Get-PackageInfo']
 if ('~' in package):
  cmd.append('/PackageName:{0}'.format(package))
 else:
  cmd.append('/PackagePath:{0}'.format(package))
 out = __salt__['cmd.run_all'](cmd)
 if (out['retcode'] == 0):
  ret = dict()
  for line in str(out['stdout']).splitlines():
   if (' : ' in line):
    info = line.split(' : ')
    if (len(info) < 2):
     continue
    ret[info[0]] = info[1]
 else:
  ret = out
 return ret

def package_info ( package , image = None ) : cmd = [ 'DISM' , '/English' , ( '/Image:{0}' . format ( image ) if image else '/Online' ) , '/Get-PackageInfo' ] if ( '~' in package ) : cmd . append ( '/PackageName:{0}' . format ( package ) ) else : cmd . append ( '/PackagePath:{0}' . format ( package ) ) out = __salt__ [ 'cmd.run_all' ] ( cmd ) if ( out [ 'retcode' ] == 0 ) : ret = dict ( ) for line in str ( out [ 'stdout' ] ) . splitlines ( ) : if ( ' : ' in line ) : info = line . split ( ' : ' ) if ( len ( info ) < 2 ) : continue ret [ info [ 0 ] ] = info [ 1 ] else : ret = out return ret
display information about a package args: package : the full path to the package .