Powershell의 Install-Module 명령이란 무엇입니까?


8

다양한 Microsoft 기사에서 Powershell 명령 Install-Module을 참조하지만 실제로 이것이 무엇인지에 대한 참조를 찾을 수 없으며 인터넷 검색에 매우 적합하지 않습니다. 나는 한 psget은 내가 설치 - 모듈의 버전이 있으므로, 설치 ...하지만 나는 다른 사람에 대해 얘기하고있는 설치 - 모듈하지 생각합니다.

아, 이 Install-Module을 찾았습니다 . PsGet이 설치 한 것과 다른 것입니까? 그렇다면 PsGet을 제거해야 기본 설정으로 돌아갑니다.


"다른가요?" - 아니; 이 예 Install-Module에서는를 설치하는 데 사용됩니다 Azure Resource Manager. Install-Module자체는 PowerShell 3.0의 Azure Resource Manager일부이며 PowerShell 5의 일부
Ramhound

감사합니다 @Ramhound-psget이 설치되어 Install-Module 명령을 추가하므로 PS와 함께 제공되는 Install-Module을 덮어 쓴 것으로 가정합니다.
Rory

나는 보장되지는 않지만 모듈 자체에 안전한 내기가 추가되면 가정합니다.
Ramhound

답변:


18

이전 버전 의을 ( 를) 덮어 쓴 PSGet 을 설치 했습니다Install-Module . 실행 help install-module하여 이를 확인 하고 참조하는 버전을 확인할 수 있습니다 .

PSGet에 대한 제거 설명서를 찾을 수 없으므로 폴더를 삭제하여 제거했습니다 C:\Users\Rory\Documents\WindowsPowerShell\Modules\PSGet. 이제 help install-moduleMicrosoft 버전을 말합니다.


1
참조가없는 모듈을 제거하는 올바른 방법입니다. PsGet에는 기본적으로 아무것도 없으므로 제거하기 만하면됩니다.
Mike Chaliy

1
이를 적용하려면 Powershell 명령 창을 다시 시작해야합니다.
David White

1
내 컴퓨터에서 psget은 C : \ Program Files \ WindowsPowerShell \ Modules
dinnouti

9

명령 앞에 모듈 이름붙여서 충돌을 해결할 수 있습니다 .

PsGet 설치 및 방법 :

C:\repos> install-module csproj
Module csproj was not found in central repository
At C:\Users\Administrator\Documents\WindowsPowerShell\Modules\PsGet\PsGet.psm1:694 char:13
+             throw "Module $Module was not found in central repository ...
+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Module csproj w...tral repository:String) [], RuntimeException
    + FullyQualifiedErrorId : Module csproj was not found in central repository

규정 된 이름을 사용하여 :

C:\repos> powershellget\install-module csproj

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"): y
C:\repos>

http://windowsitpro.com/blog/dealing-cmdlet-name-conflicts 덕분에

설명서의 URL을 읽어 얻은 모듈 이름-https: //msdn.microsoft.com/powershell/reference/5.1/PowerShellGet/install-module

자세한 정보 : https://andrwwatt.wordpress.com/2006/05/13/coping-with-a-powershell-naming-clash/

당사 사이트를 사용함과 동시에 당사의 쿠키 정책개인정보 보호정책을 읽고 이해하였음을 인정하는 것으로 간주합니다.
Licensed under cc by-sa 3.0 with attribution required.