Editar

Set-HcsWebProxy

Sets the web proxy configuration.

Syntax

Set-HcsWebProxy
   [-ConnectionURI] <String>
   [-Authentication] <WebProxyAuthType>
   [-Username <String>]
   [-Password <SecureString>]
   [-Force]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Set-HcsWebProxy cmdlet sets the web proxy configuration for this device. After you set the configuration, you must enable the web proxy by using the Enable-HcsWebProxy cmdlet.

Examples

Example 1: Configure a web proxy

PS C:\> Set-HcsWebProxy -Authentication None -ConnectionURI "http://myproxy:8080"
ConnectionURI                                Authentication Username                                          IsEnabled
-------------                                -------------- --------                                          ---------
http://myproxy:8080                                    None                                                       False

This command configures the web proxy that has the URI http://myproxy:8080. The proxy uses no authentication.

Example 2: Configure a web proxy with NTLM authentication

PS C:\> Set-HcsWebProxy -Authentication NTLM -ConnectionURI "http://myproxy:8080" -Username "ENarvaez"
WARNING: A script or application on the remote computer 10.122.103.105 is sending a prompt request. When you are
prompted, enter sensitive information, such as credentials or passwords, only if you trust the remote computer and the
application or script that is requesting the data.
Password: ****
WARNING: A script or application on the remote computer 10.122.103.105 is sending a prompt request. When you are
prompted, enter sensitive information, such as credentials or passwords, only if you trust the remote computer and the
application or script that is requesting the data.
Confirm Password: ****

ConnectionURI                                Authentication Username                                          IsEnabled
-------------                                -------------- --------                                          ---------
http://myproxy:8080                                    NTLM ENarvaez                                              False

This command configures the web proxy to use NTLM authentication for user named ENarvaez.

Example 3: Configure a web proxy with Basic authentication

PS C:\> Set-HcsWebProxy -Authentication Basic -ConnectionURI "http://myproxy:8080" -Password $Null -Username "ENarvaez" 
ConnectionURI                                Authentication Username                                          IsEnabled
-------------                                -------------- --------                                          ---------
http://myproxy:8080                                   Basic ENarvaez                                              False

This command configures the web proxy to use Basic authentication with no password.

Parameters

-Authentication

Specifies the type of authentication to use. The acceptable values for this parameter are:

  • None
  • Basic
  • NTLM
Type:WebProxyAuthType
Accepted values:None, Basic, NTLM
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ConnectionURI

Specifies the URI for the web proxy server.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Force

Forces the command to run without asking for user confirmation.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Password

Specifies a password. Specify a secure string for this parameter. The cmdlet uses this password to connect to the web proxy.

Type:SecureString
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-Username

Specifies a user name for the web proxy.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Outputs

Microsoft.HCS.Management.Platform.Support.WebProxyInfo

The WebProxyInfo object has the following properties:

  • String ConnectionURI
  • WebProxyAuthType Authentication
  • String Username
  • IsEnabled