def register_repository(name, location, installation_policy=None):
 flags = [(u'Name', name)]
 flags.append((u'SourceLocation', location))
 if (installation_policy is not None):
  flags.append((u'InstallationPolicy', installation_policy))
 params = u''
 for (flag, value) in flags:
  params += u'-{0} {1} '.format(flag, value)
 cmd = u'Register-PSRepository {0}'.format(params)
 no_ret = _pshell(cmd)
 return (name not in list_modules())

def register_repository ( name , location , installation_policy = None ) : flags = [ ( u'Name' , name ) ] flags . append ( ( u'SourceLocation' , location ) ) if ( installation_policy is not None ) : flags . append ( ( u'InstallationPolicy' , installation_policy ) ) params = u'' for ( flag , value ) in flags : params += u'-{0} {1} ' . format ( flag , value ) cmd = u'Register-PSRepository {0}' . format ( params ) no_ret = _pshell ( cmd ) return ( name not in list_modules ( ) )
register a psget repository on the local machine .