question

DavidBarkley-4470 avatar image
0 Votes"
DavidBarkley-4470 asked IanXue-MSFT answered

Error trying to install any modules into powershell

PowerShell 7.1.3
Copyright (c) Microsoft Corporation.
https://aka.ms/powershell Type 'help' to get help. PS C:\Users\dbarkley> $PSVersionTable Name Value ---- ----- PSVersion 7.1.3 PSEdition Core GitCommitId 7.1.3 OS Microsoft Windows 10.0.19042
Platform Win32NT
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1
WSManStackVersion 3.0

PS C:\Users\dbarkley> install-module msonline

Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): A
Install-Package: C:\Users\dbarkley\Documents\PowerShell\Modules\PowerShellGet\2.2.5\PSModule.psm1:9711
Line |
9711 | … talledPackages = PackageManagement\Install-Package @PSBoundParameters
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Package 'MSOnline' failed to be installed because: The process cannot access the file
| 'C:\Users\dbarkley\AppData\Local\Temp\r5uneywq\Microsoft.Azure.ActiveDirectory.Client.Framework.dll'
| because it is being used by another process.

PS C:\Users\dbarkley>

This same type of error happens for any module i try to install. You can see that the data is being downloaded, but once its downloaded I receive the error that the file is already open. it is a different file each time based on the module I am trying to download

windows-server-powershell
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

IanXue-MSFT avatar image
0 Votes"
IanXue-MSFT answered

Hi,

Is there any antivirus software running? If so, you can stop the antivirus service and try again.

Best Regards,
Ian Xue
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.