PowerShell

PowerShellGallery – You are installing modules from an untrusted repository

When you start working with PowerShell Modules you often find yourself in having to approve module updates over and over and over.

Install-Module PSWriteWord -AllowPrerelease

While it's great if you don't trust PowerShellGallery I tend to trust that gallery because Microsoft runs it and I only install modules I've verified prior to installation.

💡 How can I trust PowerShellGallery?

Get-PSRepository

To fix this problem simply use command below to set InstallationPolicy to trusted.

Set-PSRepository -Name 'PSGallery' -InstallationPolicy Trusted

That's all. Simple one line of code and you trust PowerShellGallery and can install modules from there without any prompts.

This post was last modified on June 7, 2025 11:44

Przemyslaw Klys

System Architect with over 14 years of experience in the IT field. Skilled, among others, in Active Directory, Microsoft Exchange and Office 365. Profoundly interested in PowerShell. Software geek.

Share
Published by
Przemyslaw Klys

Recent Posts

Supercharging Your Network Diagnostics with Globalping for NET

Ever wondered how to run network diagnostics like Ping, Traceroute, or DNS queries from probes…

7 days ago

Automating Network Diagnostics with Globalping PowerShell Module

Are you tired of manually running network diagnostics like Ping, Traceroute, or DNS queries? The…

1 week ago

Enhanced Dashboards with PSWriteHTML – Introducing InfoCards and Density Options

Discover new features in the PSWriteHTML PowerShell module – including New-HTMLInfoCard, improved layout controls with…

2 weeks ago

Mastering Active Directory Hygiene: Automating SIDHistory Cleanup with CleanupMonster

Security Identifier (SID) History is a useful mechanism in Active Directory (AD) migrations. It allows…

2 weeks ago

Upgrade Azure Active Directory Connect fails with unexpected error

Today, I made the decision to upgrade my test environment and update the version of…

2 weeks ago

Mastering Active Directory Hygiene: Automating Stale Computer Cleanup with CleanupMonster

Have you ever looked at your Active Directory and wondered, "Why do I still have…

2 weeks ago