Closed StefanoN-Infotronics closed 3 years ago
Not sure I'm following you? At line 556 I'm creating the headers with filename what will get the name of the file (and part of the path relative to "/nsconfig/ssl/"and I specify the filelocation with value "/nsconfig/ssl/".
$adcCert = Invoke-ADCRestApi -Session $Session -Method GET -Type sslcertkey -Resource $Name -ErrorAction SilentlyContinue
$currentCert = $adcCert.sslcertkey
$payload = @{"filename" = "$($currentCert.cert)"; "filelocation" = "/nsconfig/ssl/" }
$response = Invoke-ADCRestApi -Session $Session -Method GET -Type systemfile -Arguments $payload -ErrorAction SilentlyContinue
Then I'm Getting the file. I just verified it and it works even is certs are in a sub directory, I'm also currently using 13.0 for main testing.
That is strange. I get a file not found unless i change the $payload line to: $payload = @{"filename" = "$(Split-Path $currentCert.cert -leaf)"; "filelocation" = "/nsconfig/ssl/" }
Without the split-path, I get the full path to the file as the filename, not just the relative path
I've changed a lot in the recent Dev build, can you verify if you still have any issues?
Removed the "Get-ADCCurrentCertificate" and related code. as this didn't worked as intended. Implemented other methods. The other issues should be resolved in earlier versions (also in the latest v2.9.0 version)
The payload for the systemfile REST api requires a filename and location. You are passing in a fully pathed filename, which it should be JUST the filename. It does not find the file otherwise. I am using version 13 of the ADC