|
1 | 1 | function New-NexusNugetProxyRepository { |
2 | | -<# |
| 2 | + <# |
3 | 3 | .SYNOPSIS |
4 | 4 | Creates a new NuGet Proxy Repository |
5 | 5 |
|
@@ -114,7 +114,7 @@ $ProxyParameters = @{ |
114 | 114 |
|
115 | 115 | New-NexusNugetProxyRepository @ProxyParameters |
116 | 116 | #> |
117 | | - [CmdletBinding(HelpUri = 'https://nexushell.dev/New-NexusNugetProxyRepository/',DefaultParameterSetname="Default")] |
| 117 | + [CmdletBinding(HelpUri = 'https://nexushell.dev/New-NexusNugetProxyRepository/', DefaultParameterSetname = "Default")] |
118 | 118 | Param( |
119 | 119 | [Parameter(Mandatory)] |
120 | 120 | [String] |
@@ -208,7 +208,7 @@ New-NexusNugetProxyRepository @ProxyParameters |
208 | 208 | $EnableAutoBlocking = $false, |
209 | 209 |
|
210 | 210 | [Parameter()] |
211 | | - [ValidateRange(0,10)] |
| 211 | + [ValidateRange(0, 10)] |
212 | 212 | [String] |
213 | 213 | $ConnectionRetries, |
214 | 214 |
|
@@ -242,8 +242,6 @@ New-NexusNugetProxyRepository @ProxyParameters |
242 | 242 |
|
243 | 243 | $FullUrlSlug = $formatUrl + "/proxy" |
244 | 244 |
|
245 | | - $AuthenticationType = $AuthenticationType.ToLower() |
246 | | - |
247 | 245 | $body = @{ |
248 | 246 | name = $Name |
249 | 247 | online = [bool]$Online |
@@ -288,23 +286,24 @@ New-NexusNugetProxyRepository @ProxyParameters |
288 | 286 |
|
289 | 287 | if ($UseAuthentication) { |
290 | 288 |
|
291 | | - switch($AuthenticationType){ |
| 289 | + switch ($AuthenticationType) { |
292 | 290 | 'Username' { |
293 | 291 | $authentication = @{ |
294 | | - type = $AuthenticationType |
| 292 | + type = $AuthenticationType.ToLower() |
295 | 293 | username = $Credential.UserName |
296 | 294 | password = $Credential.GetNetworkCredential().Password |
297 | | - ntlmHost = '' |
| 295 | + ntlmHost = '' |
298 | 296 | ntlmDomain = '' |
299 | 297 | } |
300 | 298 |
|
301 | 299 | $body.httpClient.Add('authentication', $authentication) |
302 | 300 | } |
303 | 301 |
|
304 | 302 | 'NTLM' { |
305 | | - if(-not $HostnameFqdn -and $DomainName){ |
| 303 | + if (-not $HostnameFqdn -and $DomainName) { |
306 | 304 | throw "Parameter HostnameFqdn and DomainName are required when using WindowsNTLM authentication" |
307 | | - } else { |
| 305 | + } |
| 306 | + else { |
308 | 307 | $authentication = @{ |
309 | 308 | type = $AuthenticationType |
310 | 309 | username = $Credential.UserName |
|
0 commit comments