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>
-Credential <ICredentials>
-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?False
-BypassOnLocal <SwitchParameter>
If specified, requests to local Internet resources do not use the configured proxy.
Required?False
Position?Named
Accept pipeline input?False
-Credential <ICredentials>
The credentials to submit to the proxy server for authentication
Required?False
Position?5
Accept pipeline input?False
AliasesCredentials
-Hostname <String>
Proxy server host
Required?False
Position?1
Accept pipeline input?False
-Password <String>
Password to submit to the proxy server for authentication
Required?False
Position?4
Accept pipeline input?False
-Port <Int32>
Proxy server port
Required?False
Position?2
Accept pipeline input?False
-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?False

Inputs

This cmdlet does not accept pipeline input.

Outputs

None
This cmdlet does not generate any output.

Examples

Example 1

PS C:\>Set-AWSProxy -Hostname localhost -Port 8888
This command configures a proxy that does not require special credentials.

Example 2

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

Example 3

PS C:\>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

PS C:\>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 IP 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. You can use semicolons as a delimiter between IP addresses that you want to bypass.

Example 5

PS C:\>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 6

PS C:\>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. This example, unlike the preceding example, uses semicolons, which are accepted as a delimiter between the quotation-enclosed proxy values. This example formats the BypassList values without the parentheses-enclosed array.

Supported Version

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