New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cert:\ PSDrive is unavailable on PowerShell 5.1 launched by cmd when cmd is launched on PowerShell 7.3 #18530
Comments
It looks like this bug was introduced in 7.3.0-preview.7. More specifically, I believe it was introduced by #16355. Check this out:
Here's what I think is happening: PowerShell 7 modifies the value of Since the PowerShell 7 version of In the meantime, as a workaround, if you're able to modify the scripts that started failing on you, have them explicitly import version 3.0.0.0 of |
Thank you for the information, dwtaber. Importing Microsoft.PowerShell.Security 3.0.0.0 explicitly mitigated the error. |
When we approved the change to move the types out of SMA, we didn't anticipate the impact on the |
The root problem is that when doing With the incorrect module path value, when doing Doing the That’s why we special-cased the @masaru-iritani In your workflow, I suggest you unset the environment variable |
Ok, what @daxian-dbw says makes sense to me based on how this works and "supposed" to work. |
This issue has been marked as answered and has not had any activity for 1 day. It has been closed for housekeeping purposes. |
Copying my comment over from a duplicate bug: I'm hitting this bug in a long-term product support codebase and probably can't check in the workaround. I also suspect we'll see more reports of this issue as more people move to 7.3, and the error message gives no easy indication of what the problem is. If |
I had azure pipeline that uses powershell inline script which runs on an self-hosted build agent where I have powershell standard and Ps7, Pipeline used to work like a charm until I upgraded 2 weeks back PS7 to 7.3 I opened a ticket with VS community at They pointed me to this ticket
So not sure what is needed to be doen in order to make the script in the pipeline work correctly
|
* debug sign build * Update sign.py: set PSModulePath PowerShell/PowerShell#18530 (comment)
Prerequisites
Steps to reproduce
Cert:\
PSDrive provided by Certificate provider is unavailable on PowerShell 5.1 launched by cmd.exe if and only if the cmd.exe was launched on PowerShell 7.3. This issue causes an error on running a batch script which launches PowerShell 5.1.Although this issue happens on PowerShell 5.1, I file it for PowerShell 7.3 because it is reproduced only when cmd.exe is launched on PowerShell 7.3.
Expected behavior
Actual behavior
Error details
No error is returned.
Environment data
Visuals
CertPSDriveUnavailable.zip is a step recording capturing following steps.
The text was updated successfully, but these errors were encountered: