Prerelease Module in PowerShell 5 installieren

PowerShell Module mit einer Version 0.x, oder solche die sich im Preview Modus befinden, können oft nicht in PowerShell 5 installiert werden. Mit einem Update wird es möglich.

Manche PowerShell Module inkludieren in der PowerShell Gallery den Zusatz AllowPrerelease. Am Beispiel des PnP PowerShell Moduls.

In der Standardinstallation von PowerShell 5 sind diese Prerelease-Module oft nicht installierbar. Bei Install-Module gibt es den Parameter AllowPrerelease nicht. Der Grund ist das vorinstallierte Modul PowerShellGet. PowerShellGet unterstützt erst ab Version 1.6 die Installation von Prerelease Module. Die Aktualisierung von PowerShellGet wird vergessen und so verbleibt das Modul lange Zeit auf Version 1.0.

  • Prüfe welche Version von PowerShellGet installiert ist.
Get-Module PowerShellGet
  • Im Moment ist PowerShellGet 2.x aktuell bzw. Version 3 in Preview.
  • Da PowerShellGet ein Modul ist wird die Aktualisierung, wie bei einem PowerShell Modul üblich, mit Update-Module versucht.
  • Bei PowerShellGet kann es mit Update-Module zu Fehlermeldungen führen. Version 1 von PowerShellGet ist oft bereits vorinstalliert. Dadurch ist eine forcierte Neuinstallation des Moduls erforderlich.
    Wichtig ist nach der Installation nicht zu vergessen das PowerShellGet Modul aus der PowerShell Session zu entfernen und neu zu importieren. Alternativ öffnest du PowerShell einfach neu. Andernfalls wird es die alte Version auflisten.
  • Nun wird der Parameter AllowPrerelease in PowerShell 5 verfügbar sein und es damit möglich Module im Prerelease Modus zu installieren.

Share
Avatar photo

Tobias Asböck

Tobias is a Senior System Engineer with more than 10 years of professional experience with Microsoft 365 products such as SharePoint Online, SharePoint Premium, OneDrive for Business, Teams Collaboration, Entra ID, Information Protection, Universal Print, and Microsoft 365 Licensing. He also has 15+ years of experience planning, administering, and operating SharePoint Server environments. Tobias is a PowerShell Scripter with certifications for Microsoft 365 products. In his spare time, Tobias is busy with updates in the Microsoft 365 world or on the road with his road bike and other sports activities. If you have additional questions, please contact me via LinkedIn or [email protected].

Leave a Reply

Your email address will not be published. Required fields are marked *