PSPKI
PSPKI copied to clipboard
Get-CertificationAuthority / not supported path
Hi I have something similar to https://github.com/PKISolutions/PSPKI/issues/111:
With Get-CertificationAuthority, I got a "The given path's format is not supported." Error (UNC Path):
PS C:\windows\system32> Import-module -Name PSPKI -Prefix PSPKI
PS C:\windows\system32> $oCertAuth = Get-PSPKICertificationAuthority -Name "Test-Casandra-Issuing-CA-00"
PS C:\windows\system32> $oSubReqRes = Submit-PSPKICertificateRequest -Path "\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00" -CertificationAuthority $oCertAuth -Attribute Certificate
Template:Casandra_AAF_2
Exception calling "ReadAllText" with "1" argument(s): "The given path's format is not supported."
At C:\Program Files\WindowsPowerShell\Modules\PSPKI\3.7.2\Client\Submit-CertificateRequest.ps1:70 char:5
+ ... $Request = [IO.File]::ReadAllText((Resolve-Path $_).Path) ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : NotSupportedException
Okay, so I try only this part where the error referenced:
PS C:\windows\system32> [IO.File]::ReadAllText((Resolve-Path "\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00").Path)
Exception calling "ReadAllText" with "1" argument(s): "The given path's format is not supported."
At line:1 char:1
+ [IO.File]::ReadAllText((Resolve-Path "\\filer-00\pki00$\csr\Ca ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : NotSupportedException
Some more tries in the deep:
PS C:\windows\system32> (Resolve-Path "\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00").Path
Microsoft.PowerShell.Core\FileSystem::\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00
PS C:\windows\system32> (Resolve-Path "\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00").ProviderPath
\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00
PS C:\windows\system32> [IO.File]::ReadAllText((Resolve-Path "\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00").ProviderPath)
-----BEGIN CERTIFICATE REQUEST-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE REQUEST-----
PS C:\windows\system32> (Resolve-Path "\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00")|select *
Drive Provider ProviderPath Path
----- -------- ------------ ----
Microsoft.PowerShell.Core\FileSystem \\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00 Microsoft.PowerShell.Core\FileSystem::\\filer-00\pki00$\csr\Casandra_AAF\MyDevice3-pem_req__Test-Casandra-Issuing-CA-00
PS C:\windows\system32> Get-Host | Select-Object Version
Version
-------
5.1.14393.3053
PS C:\windows\system32>
I think, should be solvable?
gruss ivo
You can fix it yourself until next version. Update this line in Submit-CertificateRequest file:
$Request = [IO.File]::ReadAllText((Resolve-Path $_).Path)
to this:
$Request = [IO.File]::ReadAllText((Resolve-Path $_).ProviderPath)
Yes, that's what I did :-)
A fix is added.
Fixed in v4.0.0