@@ -194,7 +194,7 @@ function Set-ArubaCPVmFirstBoot {
194
194
[Diagnostics.CodeAnalysis.SuppressMessageAttribute (" PSUseShouldProcessForStateChangingFunctions" , " " )]
195
195
Param (
196
196
[Parameter (Mandatory = $true )]
197
- [ValidateSet (" 6.8" , " 6.9" , " 6.10" )]
197
+ [ValidateSet (" 6.8" , " 6.9" , " 6.10" , " 6.11 " )]
198
198
[version ]$version ,
199
199
[Parameter (Mandatory = $true )]
200
200
[ValidateSet (" CLABV" , " C1000V" , " C2000V" , " C3000V" )]
@@ -311,7 +311,7 @@ function Set-ArubaCPVmSetup {
311
311
Param (
312
312
[string ]$name_vm ,
313
313
[Parameter (Mandatory = $true )]
314
- [ValidateSet (" 6.8" , " 6.9" , " 6.10" )]
314
+ [ValidateSet (" 6.8" , " 6.9" , " 6.10" , " 6.11 " )]
315
315
[version ]$version ,
316
316
[Parameter (Mandatory = $true )]
317
317
[string ]$hostname ,
@@ -597,11 +597,19 @@ function Set-ArubaCPVmAddLicencePlatform {
597
597
}
598
598
599
599
Process {
600
- $uri = " https://" + $mgmt_ip + " /tips/submitLicense .action"
600
+ $uri = " https://" + $mgmt_ip + " /tips/addLicense .action"
601
601
$body = @ { appId = 101 ; agree_eula = " on" ; licenseKey = $licencekey }
602
+ # Token ? (for > 6.11)
603
+ $iwr = Invoke-WebRequest $uri - Method " GET" - SkipCertificateCheck - SessionVariable LicenceCPPM
604
+ $token = ($iwr.InputFields | Where-Object {$_.name -eq " token" }).value
605
+ if ($token ) {
606
+ $body.add (" struts.token.name" , " token" )
607
+ $body.add (" token" , $token )
608
+ }
609
+ $uri = " https://" + $mgmt_ip + " /tips/submitLicense.action"
602
610
Write-Verbose ($body | ConvertTo-Json )
603
611
# No API available for this... push directly the licence with agreement eula
604
- Invoke-WebRequest $uri - Method " POST" - ContentType " application/x-www-form-urlencoded" - Body $body - SkipCertificateCheck | Out-Null
612
+ Invoke-WebRequest $uri - Method " POST" - ContentType " application/x-www-form-urlencoded" - Body $body - WebSession $licenceCPPM - SkipCertificateCheck | Out-Null
605
613
}
606
614
607
615
End {
0 commit comments