-
Notifications
You must be signed in to change notification settings - Fork 71
AU module may not be automatically available when installed via Chocolatey #15
Comments
Mhm... I am not sure why is it not working for you. It should just works because As an example, this is an install on Win 8.1 machine that didn't have it before:
For some reason it didn't even fail non admin shell. |
Perhaps your |
PowerShell 3 has less paths in PSModulePath than Posh v4+. I think it something with my local computer though. |
Do you have any idea why it passed without admin shell ? On my other Win 10 it failed... UAC is set to dfaults on both machines... |
Two or three days ago when I installed au, I had to to run My system:
|
The I installed it on my Win10 (same spec as yours) without a problem. It might be a posh 5 problem that I encounter from time to time - some modules do not seem to get autoloaded sometimes... |
Also, please give the output of the |
I have now |
As I expected, your user specific module directory is not there and thats why it didn't work via chocolatey. It worked via Now, I must look into this - why user specific folder isn't included in In any way, I declare this as a bug and will see to install into machine location by default as current user folder is unreliable. |
Fixing a Missing Path in PSModulePath article details about this and provides script:
Microsoft itself says:
So this means that your system @ComFreek does not contain normal defaults. So, there are 3 things that can be done:
Thoughts ? |
There is also an option to add au's location to the psmodulepath which is less intrusive then adding $HOME, but $HOME should really be there in the first place. |
I think I tracked down the problem. On my system I have moved all user-specific directories (Contacts, Pictures, Music, Videos, Documents, Desktop, Downloads etc.) to another partition, namely D. Note that "moved" means the way via the Properties dialog of each directory, so that Windows is notified about it.
It does: I had a look at your chocolateyInstall.ps1. In line 23 (direct link) it contains $module_dst = "$Env:UserProfile\Documents\WindowsPowerShell\Modules\$packageName\$Env:ChocolateyPackageVersion" Outputting $Env:UserProfile on my system showed me A quick Google searched turned up the correct way to determine the Documents directory: StackOverflow: Getting the user's Documents folder in Powershell: [Environment]::GetFolderPath("MyDocuments") Indeed, it does correctly return |
Update:
|
@ComFreek , however, as per MSDN page, this folder location is I know why it doesn't find the module at your location, it has invalid version (where revision comes from ?) The version that you see in folder must be the same as in I think I will just use machine location and thats it: |
PowerShell v5 uses versions, I don't think PowerShell v3/4 allowed for versions as part of the path. |
@ComFreek if you remove the |
AU moved to |
I suspect a documentation error on this page: https://msdn.microsoft.com/en-us/library/dd878350(v=vs.85).aspx.
That fixed it! Import-Module now finds it. |
There is a pattern seen in Chocolatey packages that manage PowerShell modules. I would like to see that done with the au package (which I realize is in a different repository).
I'd really like to
choco install au
and have it import the module to the proper location, right now I don't see the ability to immediately use what I've installed, which IMHO means the package is incomplete.There are others as well.
The text was updated successfully, but these errors were encountered: