Install Module in Powershell without Install-Module

The term ‘Install-Module’ is not recognized as the name of a cmdlet.

Have you ever found yourself in trouble because your Powershell is not working anymore after a colleague told you to just delete every module of Windows Powershell? No prob…


This content originally appeared on DEV Community and was authored by Nils Diekmann

The term ‘Install-Module’ is not recognized as the name of a cmdlet.

Have you ever found yourself in trouble because your Powershell is not working anymore after a colleague told you to just delete every module of Windows Powershell? No problem… you can just use Install-Module to reinstall everything. Oops… Install-Module is part of the module you just deleted. Here is the guide on how to escape this chicken and egg problem.

Chicken - Egg - Problem

How to restore Install-Module manually

To restore functionality, you need two modules. PowerShellGet and its dependency PackageManagement. You can get them from the Powershell Gallery. Search for the modules and click on ‘Manual Download’. There you will also find a helpful description of how to install these Nuget packages manually. Follow the instructions step by step. Only in step 5, you should first create a subfolder containing the version of the module. Restart your PowerShell and you can install all other modules now.

Are you a developer and too lazy to do things manually?

Since you already use Powershell, why not just use Powershell?

Finally, copy the two folders PowerShellGet and PackageManagement to your Powershell Module folder. You will get a warning that the files are marked as untrusted. If anyone finds a solution, please leave a comment.

If you are simply smart and pragmatic

Use the Windows Recycle Bin to restore the PowerShellGet and PackageManagement modules.

Please also leave a comment if anyone else is experiencing the same problem. Together we are strong 💪♥️❤♥️

Love for all
Foto von Tim Marshall auf Unsplash


This content originally appeared on DEV Community and was authored by Nils Diekmann


Print Share Comment Cite Upload Translate Updates
APA

Nils Diekmann | Sciencx (2024-07-02T21:26:27+00:00) Install Module in Powershell without Install-Module. Retrieved from https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/

MLA
" » Install Module in Powershell without Install-Module." Nils Diekmann | Sciencx - Tuesday July 2, 2024, https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/
HARVARD
Nils Diekmann | Sciencx Tuesday July 2, 2024 » Install Module in Powershell without Install-Module., viewed ,<https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/>
VANCOUVER
Nils Diekmann | Sciencx - » Install Module in Powershell without Install-Module. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/
CHICAGO
" » Install Module in Powershell without Install-Module." Nils Diekmann | Sciencx - Accessed . https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/
IEEE
" » Install Module in Powershell without Install-Module." Nils Diekmann | Sciencx [Online]. Available: https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/. [Accessed: ]
rf:citation
» Install Module in Powershell without Install-Module | Nils Diekmann | Sciencx | https://www.scien.cx/2024/07/02/install-module-in-powershell-without-install-module/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.