GithubHelp home page GithubHelp logo

Comments (4)

JohnGoldsmith avatar JohnGoldsmith commented on May 29, 2024

So on further investigation, a couple of things appear to be happening. Installation scope appears not to be working correctly and setting the User variable, PSModulePath, appears to interfere with Module discovery.

Running the msi installs per-user even though the install scope (Advanced button) is set to all users. However if you toggle the install scope radio buttons and finally select all users, then it installs as expected (as all users) and other non-pnp modules are discovered correctly.

When installing for all users the User variable PSModulePath is not created and Powershell seems to handle the Documents located modules ok.

So just to confirm, having installed for all users, there is no entry for PSModulePath under the User scope and the System scope looks like this:

%SystemRoot%\system32\WindowsPowerShell\v1.0\Modules;
C:\Program Files\Intel;
C:\Program Files (x86)\Microsoft SDKs\Azure\PowerShell\ServiceManagement;
C:\Program Files (x86)\SharePoint Online Management Shell;
C:\Program Files\SharePoint Online Management Shell;
C:\Program Files (x86)\OfficeDevPnP.PowerShell.Commands\

I did come across a Sapien post https://www.sapien.com/blog/2012/05/22/psmodulepath-discrepancies/ that suggests that the Documents and ProgramFiles\WindowsPowerShell\Modules paths are added by default (unless modified?), but I'm not certain if that's the case here.

Best regards

John

from pnp-powershell.

TobiasWeltner avatar TobiasWeltner commented on May 29, 2024

When you test-drive your MSI package, no matter what you do, always make sure you never change existing values. The default user profile modules folder must at all times be part of PSModulePath, or else you disable all user-specific modules from other sources.

In fact, you should not modify PSModulePath at all. Simply pick one of the default locations.

from pnp-powershell.

rjesh-git avatar rjesh-git commented on May 29, 2024

Can you try "Set-ExecutionPolicy Unrestricted -Force" in PowerShell window?

from pnp-powershell.

JohnGoldsmith avatar JohnGoldsmith commented on May 29, 2024

Hi rjesh,
Well I installed for all users and then it worked correctly (as above). The issue, I believe, is other non-pnp modules not being discovered when the user PSModulePath variable is set. For the record, though, my Execution Policy is set to Bypass.

from pnp-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.