Save-Module
업데이트 날짜: 2015년 8월
Save-Module
Saves a module locally without installing it.
구문
Parameter Set: NameAndPathParameterSet
Save-Module [-Force] [-InputObject] <PSObject[]> [-MaximumVersion] <Version> [-MinimumVersion] <Version> [-Name] <String[]> [-Path] <String> [-Repository] <String[]> [-RequiredVersion] <Version>
Parameter Set: InputOjectAndLiteralPathParameterSet
Save-Module [-Force] [-InputObject] <PSObject[]> [-LiteralPath] <String>
Parameter Set: InputOjectAndPathParameterSet
Save-Module [-Force] [-InputObject] <PSObject[]> [-Path] <String>
Parameter Set: NameAndLiteralPathParameterSet
Save-Module [-Force] [-InputObject] <PSObject[]> [-LiteralPath] <String> [-MaximumVersion] <Version> [-MinimumVersion] <Version> [-Name] <String[]> [-Repository] <String[]> [-RequiredVersion] <Version>
자세한 설명
The Save-Module cmdlet lets you save a gallery-based module locally without installing it. This lets you inspect the module’s contents before you install a module, helping to minimize the risks of malicious code or malware on your system.
As a best practice, when you have finished evaluating a module for potential risks, and before you install the module for use, delete the module from the path to which you have saved it.
매개 변수
-Force
Forces the specified modules to be saved. If a module of the same name and version already exists in the specified path, this parameter overwrites the existing module with one of the same name that was found by the command.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-InputObject<PSObject[]>
Specifies a PSGetItemInfo object. You can run Find-Module to obtain a PSGetItemInfo object that you can pipe into Save-Module.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-LiteralPath<String>
Specifies an exact path to which you want to save the module. For best results, enclose paths in quotation marks.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-MaximumVersion<Version>
Specifies the maximum version of a single module to save. You cannot add this parameter if you are attempting to save multiple modules. The MaximumVersion and the RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.
별칭 |
Version |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-MinimumVersion<Version>
Specifies the minimum version of a single module to save to your local computer. You cannot add this parameter if you are attempting to save multiple modules. The MinimumVersion and the RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command.
If you are saving multiple modules in a single command, and a specified minimum version for a module is not available, the Save-Module command will silently continue without saving the module for which it cannot find the specified minimum version. For example, if you try to save the ContosoServer module with a minimum version of 2.0, but the newest version of the ContosoServer module is only 1.5, your Save-Module command will not save the ContosoServer module; it will go on to save the next specified module, and Windows PowerShell will display errors when the command is finished.
별칭 |
Version |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-Name<String[]>
Specifies the exact names of modules to save from the online gallery. This parameter supports wildcard characters. If wildcard characters are not specified, only modules that exactly match the specified names are returned. If no matches are found, and you have not used any wildcard characters, the command returns an error. If you use wildcard characters, but do not find matching results, no error is returned. (This follows standard wildcard character matching behavior for Windows PowerShell.)
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-Path<String>
Specifies a path to which you want to save the module. For best results, enclose paths in quotation marks.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-Repository<String[]>
The friendly name of a repository that has been registered by running Register-PSRepository. The repository must have a PublishLocation, which is a valid NuGet URI. The PublishLocation can be set by running Set-PSRepository. The default value of this parameter is PSGallery.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
-RequiredVersion<Version>
The exact version of a single module to save. You cannot add this parameter if you are attempting to save multiple modules, or use this parameter in the same command with either the MinimumVersion or MaximumVersion parameters.
별칭 |
없음 |
필수 여부 |
true |
위치 |
1 |
기본값 |
없음 |
파이프라인 입력 허용 여부 |
True (ByPropertyName) |
와일드카드 문자 허용 여부 |
false |
입력
입력 형식은 cmdlet으로 파이프할 수 있는 개체의 형식입니다.
PSModuleInfo
You can pipe PSModuleInfo object to Save-Module.
출력
출력 형식은 cmdlet 실행 시 출력되는 개체의 형식입니다.
예
-------------------------- EXAMPLE 1 --------------------------
In this example, you save only version 2.5 of a module named FabrikamServer to a path, C:\TestUser\ModulesToCheck, where you can later evaluate the module for risks before installing it.
PS C:\>Save-Module -Name FabrikamServer -RequiredVersion 2.5 -Path C:\TestUser\ModulesToCheck