psbuild icon indicating copy to clipboard operation
psbuild copied to clipboard

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

Open FlorianDecker opened this issue 8 years ago • 2 comments

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

FlorianDecker avatar Oct 30 '17 17:10 FlorianDecker

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

sayedihashimi avatar Oct 31 '17 17:10 sayedihashimi

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.

FlorianDecker avatar Nov 06 '17 13:11 FlorianDecker