Open dsolodow opened 10 months ago
It looks like the issue is with utils.cs lines 985-990. If I read it correctly, it's looking at host.version and saying "if greater than 6.0, PowerShell, if less than, Windows PowerShell". Since the VSCode PowerShell terminal returns the module version (2023.8.0) as it's host.version it's mis-interpreting it.
I think that'll be the same issue as #463 then
@andyleejordan do you know what PowerShell api we can call?
The linked issue had a note that linked to what PowerShellEditorServices does (if that helps): https://github.com/PowerShell/PowerShellEditorServices/blob/main/src/PowerShellEditorServices/Utility/VersionUtils.cs
@SydneyhSmith given the constraint that you've just got PSCmdlet
...I'm not sure but am looking at it. @SeeminglyScience any bright ideas? It has access to SessionState so there should be a good programmatic way to go about this but I'm not finding it quickly. I don't think I would want to invoke a command to do it...I mean maybe you're best off doing the reflection call like we do 🙃
no luck with a fix on this yet?
Prerequisites
Steps to reproduce
VSCode 1.83.1 with PowerShell extension 2023.8.0, set to Windows PowerShell x64. $PSVersionTable shows: Name Value
PSVersion 5.1.19041.3633 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...} BuildVersion 10.0.19041.3633 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1
When running Install-PSResource it installs into the Documents\PowerShell\Modules directory instead of Documents\WindowsPowerShell\Modules
Expected behavior
Actual behavior
Error details
No response
Environment data
Visuals
Terminal:![image](https://github.com/PowerShell/PSResourceGet/assets/7574074/04084078-e877-4d7d-8a73-9d8595d7f299)
VS Code:![image](https://github.com/PowerShell/PSResourceGet/assets/7574074/28153c7f-f6cb-4efb-9855-1da458b76cb7)