Skip to content
This repository was archived by the owner on Jun 12, 2023. It is now read-only.
This repository was archived by the owner on Jun 12, 2023. It is now read-only.

Import-PfxCertificate is not compatible with Temp:\ drive #22

@gmemstr

Description

@gmemstr

(reported here as well: PowerShell/PowerShell#15516)

Steps to reproduce

[System.Convert]::FromBase64String($certificate) | Set-Content Temp:\cert.pfx -AsByteStream
Import-PfxCertificate -FilePath Temp:\cert.pfx -Password (ConvertTo-SecureString -String "$cert_pass" -AsPlainText -Force) -CertStoreLocation Cert:\CurrentUser\My

>>> Import-PfxCertificate: C:\Users\circleci\AppData\Local\Temp\remoteIpMoProxy_PKI_1.0.0.0_localhost_9ffcc35e-4d9c-45e6-9cac-a8a2924980b3\remoteIpMoProxy_PKI_1.0.0.0_localhost_9ffcc35e-4d9c-45e6-9cac-a8a2924980b3.psm1:1279
Line |
1279 |          $steppablePipeline.End()
     |          ~~~~~~~~~~~~~~~~~~~~~~~~
     | Cannot find drive. A drive with the name 'Temp' does not exist.

Expected behavior

Certificate is imported correctly.

Actual behavior

Unable to "find temp drive", despite content being written out to the specified file correctly.

Environment data

$PSVersionTable

Name                           Value
----                           -----
PSVersion                      7.1.3
PSEdition                      Core
GitCommitId                    7.1.3
OS                             Microsoft Windows 10.0.17763
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0.}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions