Skip to content
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

Environment Enum interfers with [Environment] #24

Closed
hjorslev opened this issue Jul 12, 2020 · 0 comments · Fixed by #25
Closed

Environment Enum interfers with [Environment] #24

hjorslev opened this issue Jul 12, 2020 · 0 comments · Fixed by #25
Assignees
Labels
Category-Module Pertaining to the module's functionality itself. Issue-Bug 🐛 Something's wrong!

Comments

@hjorslev
Copy link
Owner

Describe "Module Bug or Issue"

image

Context "The Problem"

Method invocation failed because [Environment] does not contain a method named 'GetEnvironmentVariable'.
At line:1 char:1
+ [Environment]::GetEnvironmentVariable("Path")
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
    + FullyQualifiedErrorId : MethodNotFound

This error occur sometimes. It seems to be linked with the Enum named Environment as shown in the screenshot above.

Context "Expected Behavior"

Should not throw an error. This can easily be fixed by renaming the Environment Enum to OSType or similar.

Context "Additional Information"

Name                           Value                                                                                   
----                           -----                                                                                   
PSVersion                      5.1.18362.752                                                                           
PSEdition                      Desktop                                                                                 
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}                                                                 
BuildVersion                   10.0.18362.752                                                                          
CLRVersion                     4.0.30319.42000                                                                         
WSManStackVersion              3.0                                                                                     
PSRemotingProtocolVersion      2.3                                                                                     
SerializationVersion           1.1.0.1                                                                                 
@hjorslev hjorslev added Category-Module Pertaining to the module's functionality itself. Issue-Bug 🐛 Something's wrong! labels Jul 12, 2020
@hjorslev hjorslev self-assigned this Jul 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category-Module Pertaining to the module's functionality itself. Issue-Bug 🐛 Something's wrong!
Projects
None yet
1 participant