Closed fabricesemti80 closed 7 months ago
Hmm, that's weird. That script is really just two lines:
Install-Script Install-RequiredModule
Install-RequiredModule
The first line seems to have worked... Which should mean the second line can work!
My best guess is that PowerShellGet installed the script into your ~\Documents\WindowsPowerShell\Scripts
but didn't make sure that folder was in your PATH environment variable. Try looking in there:
Get-ChildItem (Split-Path $Profile | Join-Path -ChildPath Scripts)
And if you find it, add that folder to your PATH:
$Env:Path += ";" + (Split-Path $Profile | Join-Path -ChildPath Scripts)
And/or, add it permanently:
$Path = [Environment]::GetEnvironmentVariable("PATH", "User") + ";" + (Split-Path $Profile | Join-Path -ChildPath Scripts)
[Environment]::SetEnvironmentVariable("PATH", $Path, "User")
I got stuck on this for quite a while... would be helpful to include a note to hit YES when prompted to add the /Scripts folder to your path... i clicked "no" because i didn't read the prompt completely and got stuck on this for a couple hours... my way out was to just run Install-Script .\Install-RequiredModule.ps1
manually, hit "yes" when prompted to add /Scripts to PATH, ignore the following error message and then re-run .\Install-RequiredModule.ps1
. Of course, one can/should learn how to add the folder to your PATH the hard way, but I kept running into roadblocks left and right (wish i would have seen this issue sooner!)
Hello, I'm getting the following error when just starting to use this process to use the builder. What could be the problem here? Please, Thanks. Lacy
PS D:\OneDrive\OneDrive - Phoenixtekk\Documents\GitHub\ModuleBuilder> ./Install-RequiredModule.ps1 New-PSGetItemInfo : Cannot convert value "1.4.0-performance0041" to type "System.Version". Error: "Input string was not in a correct format." At C:\Program Files (x86)\WindowsPowerShell\Modules\PowerShellGet\1.0.0.1\PSModule.psm1:1399 char:30
@phoenixtekk that's a totally different problem.
You should be able to just Install-Module ModuleBuilder
instead of starting from the source of ModuleBuilder...
But if you want to build it from source, the problem you're having is that the oldest, original version of PowerShellGet can't handle preview version numbers, and doesn't know to ask the gallery not to return them in the list. I would have worked around that in the Install-RequiredModule script, but it's extremely rare to see that version nowadays.
To fix it, you just need to install the latest version of PowerShellGet:
Install-Module PowerShellGet -Force
You may need to add -AllowClobber -SkipPublisherCheck
to that, but I don't think so.
Then, you need to use that new version of PowerShellGet -- safe thing is to just restart PowerShell.
The simple fix is to Install
Error as follows:
My PS version:
Any suggestion would be appreciated!