Code Monkey home page Code Monkey logo

Comments (7)

rhubarb-geek-nz avatar rhubarb-geek-nz commented on June 14, 2024 1
PS> Get-Command Get-AppxPackage

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Function        Get-AppxPackage                                    1.0        Appx

Given that Get-AppxPackage comes from a module in 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\Appx' then it seems reasonable that it has expectations of a windows environment. As far as I can tell it is not part of the PowerShell Core project.

since in my shell scripts I sanitise (that is clear) most env vars

Fortunately, you have already identified the root cause.

If you want to have a clean environment without any environment variables that Windows programs depend on, then don't run any Windows programs that depend on those environment variables.

from powershell.

philcerf avatar philcerf commented on June 14, 2024

Maybe that's also something more general. In particular I've just noticed that the same happens with python.

from powershell.

philcerf avatar philcerf commented on June 14, 2024

If you want to have a clean environment without any environment variables that Windows programs depend on, then don't run any Windows programs that depend on those environment variables.

Well, still it's probably not good behaviour if the programs behave odd without any error, when crucial stuff is missing.

from powershell.

rhubarb-geek-nz avatar rhubarb-geek-nz commented on June 14, 2024

Well, still it's probably not good behaviour if the programs behave odd without any error, when crucial stuff is missing.

You are absolutely right, I would not recommend removing standard windows environment variables that windows apps have a reasonable expectation of being correctly set in order to operate.

from powershell.

SteveL-MSFT avatar SteveL-MSFT commented on June 14, 2024

PowerShell itself doesn't have a dependency on $env:SYSTEMDRIVE when using cmdlets in general so this seems to be something internal to the AppX module. That modules is part of Windows and not serviced as part of PowerShell so you'll need to report this via the Windows Feedback tool

from powershell.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on June 14, 2024

This issue has been marked as external and has not had any activity for 1 day. It has been be closed for housekeeping purposes.

from powershell.

microsoft-github-policy-service avatar microsoft-github-policy-service commented on June 14, 2024

📣 Hey @philcerf, how did we do? We would love to hear your feedback with the link below! 🗣️

🔗 https://aka.ms/PSRepoFeedback

from powershell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.