Skip to content

Instantly share code, notes, and snippets.

@secabstraction
Last active February 16, 2016 17:27
Show Gist options
  • Save secabstraction/02992616f3ebc4c4bcce to your computer and use it in GitHub Desktop.
Save secabstraction/02992616f3ebc4c4bcce to your computer and use it in GitHub Desktop.
# Create a connection pool
$Pool = New-ConnectionPool -Nodes @('http://test1:9200','http://test2:9200') -Sniffing
# Create a connection configuration from the pool
$Config = New-ConnectionConfiguration -Pool $Pool
# Tweak the configuration
$Config.SetBasicAuthentication('username','password')
$Config.SetProxy('http://myproxy:8080','username','password')
# Create a client from the configuration
$Client = New-ElasticClient -Configuration $Config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment