lptstr / winfetch

🛠 A command-line system information utility written in PowerShell. Like Neofetch, but for Windows.
MIT License
1.35k stars 76 forks source link

Winfetch won't run when I type winfetch #168

Closed Dhyfer1 closed 1 year ago

Dhyfer1 commented 1 year ago

Hi.

I installed Winfetch through the recommended way, using Powershell Gallery. I followed the instructions mentioned in Installation, so to start I typed the following in Powershell:

Install-Script -Name pwshfetch-test-1
Set-Alias winfetch pwshfetch-test-1    # Put this in $PROFILE

After an installation without any apparent problem, I type winfetch and it runs correctly, then I close Powershell. When I reopen Powershell to run winfetch again, this is the error message after typing winfetch:

PS C:\Users\diego> winfetch
winfetch : The term 'winfetch' is not recognized as the name of a cmdlet, function, script file, or operable program.
Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ winfetch
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (winfetch:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

However, winfetch runs correctly if I type the name of the script, which is pwshfetch-test-1

What can I do to make winfetch run just by typing winfetch?

Thanks in advance.

rashil2000 commented 1 year ago

Run this:

New-Item $PROFILE -Force
Add-Content $PROFILE 'Set-Alias winfetch pwshfetch-test-1'

Now it should work.

Dhyfer1 commented 1 year ago

Run this:

New-Item $PROFILE -Force
Add-Content $PROFILE 'Set-Alias winfetch pwshfetch-test-1'

Now it should work.

Thank you very much, now it works! 😁 But I think those commands should also be mentioned in the wiki when winfetch is installed from Powershell Gallery, don't you think?

rashil2000 commented 1 year ago

Users of PowerShell already have the $PROFILE file created, so the command to create it is not mentioned.