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

Installation of psbuild failed "Could not find part of the path" #86

Open
FlorianDecker opened this issue Oct 30, 2017 · 2 comments
Open

Comments

@FlorianDecker
Copy link

Just for documentation purpose:

I tried to install psbuild as described in the readme.

PS C:\Users\florian.decker> (new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ligershark/psbuild/master/src/GetPSBuild.ps1") | iex

This was followed by this errors:

Copy-Item : Could not find a part of the path 'C:\Users\florian.decker\AppData\Local\GitHub\shell.ps1\psbuild\'.
At line:49 char:9
+         Copy-Item -Path "$($psbPsm1File.Directory.FullName)\*"  -Dest ...
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (:) [Copy-Item], DirectoryNotFoundException
    + FullyQualifiedErrorId : System.IO.DirectoryNotFoundException,Microsoft.PowerShell.Commands.CopyItemCommand

Import-Module : The specified module 'C:\Users\florian.decker\AppData\Local\GitHub\shell.ps1\psbuild\psbuild.psm1' was
not loaded because no valid module file was found in any module directory.
At line:69 char:9
+         Import-Module -Name $moduleFile -DisableNameChecking -Force
+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (C:\Users\floria...ld\psbuild.psm1:String) [Import-Module], FileNot
   FoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

psbuild is installed and ready to use
USAGE:
    PS> Invoke-MSBuild 'C:\temp\msbuild\msbuild.proj'
    PS> Invoke-MSBuild C:\temp\msbuild\path.proj -properties (@{'OutputPath'='c:\ouput\';'visualstudioversion'='12.0'})
-extraArgs '/nologo'

For more details:
    get-help Invoke-MSBuild
Or visit http://msbuildbook.com/psbuild

The log says that the installation was successfull, although none of the commands worked afterwards.

I solved the problem by deleting the file C:\Users\florian.decker\AppData\Local\GitHub\shell.ps1 and running the installation again.

Thanks for the nice project! :)

Cheers,
Florian

@sayedihashimi
Copy link
Member

Hi @FlorianDecker thanks for the report. It's working for me on a variety of machine. What OS/PowerShell version are you running? Also can you try from the dev branch to see if that helps?

(new-object Net.WebClient).DownloadString("https://raw.githubusercontent.com/ligershark/psbuild/dev/src/GetPSBuild.ps1") | iex

@FlorianDecker
Copy link
Author

Hi!

Now that the file "C:\Users\florian.decker\AppData\Local\GitHub\shell.ps1" is removed, the psbuild install works without problems in the dev and the release version.

I investigated who could have created the "shell.ps1" file and found out that Github for Desktop creates it when started. So the install should always fail when you installed Github for Desktop (and maybe started it once) before installing psbuild.

Note, that if psbuild was installed before and created its "shell.ps1"-folder, that Github for Desktop does not create its "shell.ps1"-file.
So it is possible that there are negative side effects in Github for Desktop if psbuild is installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants