AWS Tools for Windows PowerShell
Command Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Synopsis

Sets AWS default proxy for the shell. Subsequent AWS cmdlet invocations will use the configured proxy.

Syntax

Set-AWSProxy
-Hostname <String>
-Port <Int32>
-Username <String>
-Password <String>
-BypassList <String[]>
-BypassOnLocal <SwitchParameter>
-Scope <VariableScope>

Description

Sets AWS default proxy for the shell.

Parameters

-BypassList <String[]>
An array of regular expressions that describe URIs that do not use the proxy server when accessed.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-BypassOnLocal <SwitchParameter>
If specified, requests to local Internet resources do not use the configured proxy.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Hostname <String>
Proxy server host
Required?False
Position?1
Accept pipeline input?True (ByPropertyName)
-Password <String>
Password to submit to the proxy server for authentication
Required?False
Position?4
Accept pipeline input?True (ByPropertyName)
-Port <Int32>
Proxy server port
Required?False
Position?2
Accept pipeline input?True (ByPropertyName)
-Scope <VariableScope>
This parameter allows to specify the scope of the proxy configuration to set. For details about variables scopes see https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_scopes.
Required?False
Position?Named
Accept pipeline input?True (ByPropertyName)
-Username <String>
Username to submit to the proxy server for authentication
Required?False
Position?3
Accept pipeline input?True (ByPropertyName)

Common Credential and Region Parameters

-Credential <ICredentials>
The credentials to submit to the proxy server for authentication
Required?False
Position?5
Accept pipeline input?True (ByPropertyName)
AliasesCredentials

Outputs

None
This cmdlet does not generate any output.

Examples

Example 1

Set-AWSProxy -Hostname localhost -Port 8888
This command configures a proxy that does not require special credentials.

Example 2

Set-AWSProxy -Hostname localhost -Port 8888 -Username 1 -Password 1
This command configures a proxy that requires a username and a password.

Example 3

Set-AWSProxy -Hostname localhost -Port 8888 -Credential ([System.Net.CredentialCache]::DefaultCredentials)
This command configures a proxy with default credentials. The -Credentials parameter can be used for any credentials object that implements the ICredentials interface.

Example 4

Set-AWSProxy -Hostname https://proxy.testserver.com -Port 80 -BypassList "169.254.169.250","169.254.169.251","169.254.169.254"
This command configures a proxy at https://proxy.testserver.com that uses port number 80. The -BypassList parameter is added to show that IPv4 addresses 169.254.169.250, 169.254.169.251, and 169.254.169.254 do not use the proxy. Note that because your bypass list includes only IP addresses and not FQDNs, quotation marks around the IP address values are not needed (except when using array sub-expression operator `@()`). You should use comma as a delimiter between IP addresses that you want to bypass. Also, note that if the Windows OS is configured to use IPv4, these IPv4 link-local addresses can be used.

Example 5

Set-AWSProxy -Hostname https://proxy.testserver.com -Port 80 -BypassList '[fd00:ec2::240]','[fd00:ec2::254]'
This command configures a proxy at https://proxy.testserver.com that uses port number 80. The -BypassList parameter is added to show that IPv6 addresses fd00:ec2::240 and fd00:ec2::254 do not use the proxy. If the Windows OS has the IPv4 network protocol stack disabled and uses IPv6 instead, add [fd00:ec2::240] in place of 169.254.169.250 and 169.254.169.251. Then add [fd00:ec2::254] in place of 169.254.169.254.

Example 6

Set-AWSProxy -Port 8888 -Hostname 127.0.0.1 -BypassList @("127.0.0.1", "ip-ranges.amazonaws.com")
This command configures a proxy that uses port number 8888. The -BypassList parameter is added to show that IP address 127.0.0.1, and AWS-based IP addresses, do not use the proxy. Note that because you have a mixture of an IP address and an FQDN, enclose values that you want to bypass in quotation marks as shown in the example, and use a comma as a delimiter. This example formats the values as an array, but you can also format them without parens: Set-AWSProxy -Port 8888 -Hostname 127.0.0.1 -BypassList "127.0.0.1", "ip-ranges.amazonaws.com"

Example 7

Set-AWSProxy -Port 8888 -Hostname 127.0.0.1 -BypassList "127.0.0.1","ip-ranges.amazonaws.com"
As in the preceding example, this command configures a proxy that uses port number 8888. The -BypassList parameter is added to show that IP address 127.0.0.1, and AWS-based IP addresses, do not use the proxy. Note that because you have a mixture of an IP address and an FQDN, enclose values that you want to bypass in quotation marks as shown in the example, and use a comma as a delimiter. This example formats the BypassList values without the parentheses-enclosed array.

Supported Version

AWS Tools for PowerShell: 2.x.y.z