NAME
Save-Module
SYNOPSIS
Saves a module locally without installing it.SYNTAX
Save-Module [-InputObject]
[-Confirm] [-Credential ] [-Force] -LiteralPath [-Proxy
] [-ProxyCredential ] [-WhatIf] [ ] Save-Module [-InputObject]
[-Confirm] [-Credential ] [-Force] -Path [-Proxy
] [-ProxyCredential ] [-WhatIf] [ ] Save-Module [-Name]
[-Confirm] [-Credential ] [-Force] -LiteralPath [-MaximumVersion
] [-MinimumVersion ] [-Proxy ] [-ProxyCredential ] [-Repository
] [-RequiredVersion ] [-WhatIf] [ ] Save-Module [-Name]
[-Confirm] [-Credential ] [-Force] [-MaximumVersion ] [-MinimumVersion
] -Path [-Proxy ] [-ProxyCredential ] [-Repository
] [-RequiredVersion ] [-WhatIf] [ ] DESCRIPTION
The Save-Module cmdlet saves a module locally from the specified repository for inspection. The module is not
installed.PARAMETERS
-Confirm [
Prompts you for confirmation before running the cmdlet. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] -Credential
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Force [
Forces the command to run without asking for user confirmation. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] -InputObject
{{Fill InputObject Description}} Required? true Position? 0 Default value NoneAccept pipeline input? True (ByPropertyName, ByValue)
Accept wildcard characters? false-LiteralPath
Specifies a path to one or more locations. Unlike the Path parameter, the value of the LiteralPath parameter is used exactly as entered. No characters are interpreted as wildcards. If the path includes escape characters, enclose them in single quotation marks. Windows PowerShell does not interpret any characters that are enclosed in single quotation marks as escape sequences. Required? true Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-MaximumVersion
Specifies the maximum, or newest, version of the module to save. The MaximumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-MinimumVersion
Specifies the minimum version of a single module to save. You cannot add this parameter if you are attempting to install multiple modules. The MinimumVersion and RequiredVersion parameters are mutually exclusive; you cannot use both parameters in the same command. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Name
Specifies an array of names of modules to save. Required? true Position? 0 Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Path
Specifies the path to the module that you want to publish. This parameter accepts either the path to the folder that contains the module, or the module manifest (.psd1) file. The parameter accepts piped values fromGet-Module.
Required? true Position? named Default value None Accept pipeline input? False Accept wildcard characters? false-Proxy
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-ProxyCredential
@{Text=} Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-Repository
Specifies the friendly name of a repository that has been registered by running Register-PSRepository.
Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-RequiredVersion
Specifies the exact version number of the module to save. Required? false Position? named Default value NoneAccept pipeline input? True (ByPropertyName)
Accept wildcard characters? false-WhatIf [
Shows what would happen if the cmdlet runs. The cmdlet is not run. Required? false Position? named Default value False Accept pipeline input? False Accept wildcard characters? false] This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer, PipelineVariable, and OutVariable. For more information, see about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216). INPUTS
OUTPUTS
NOTES
Example 1: Find modules and save them locally
PS C:\>Find-Module -Name "AzureAutomationDebug" -Repository "PSGallery"
Version Name Type Repository Description
------- ---- ---- ---------- -----------
1.3.5 AzureAutomationDebug Module PSGallery Module for debugging AzureAutomation runbooks, emulating AA native cmdlets PS C:\>Find-Module -Name "AzureAutomationDebug" -Repository
"PSGallery" -IncludeDependencies
Version Name Type Repository Description
------- ---- ---- ---------- -----------
1.3.5 AzureAutomationDebug Module PSGallery Module for debugging Azure Automation runbooks, emulating AA native cmdlets1.0.1 AzureRM.Automation Module PSGallery Microsoft Azure PowerShell -
Automation service cmdlets for Azure Resource Manager1.0.1 AzureRM.profile Module PSGallery Microsoft Azure PowerShell -
Profile credential management cmdlets for Azure Resource Manager PS C:\>Find-Module -Name "AzureAutomationDebug"
-Repository "PSGallery" | Save-Module -Path "C:\MyLocalModules\"
PS C:\> dir C:\MyLocalModules\
Directory: C:\MyLocalModulesMode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/14/2015 11:20 AM AzureAutomationDebug
d----- 12/14/2015 11:20 AM AzureRM.Automation
d----- 12/14/2015 11:20 AM AzureRM.profile PS C:\>Save-Module -LiteralPath
"C:\MyLocalModules\" -Name "xPSDesiredStateConfiguration" -Repository "PSGallery" -MinimumVersion 2.0
-MaximumVersion 3.5.0
PS C:\> dir C:\MyLocalModules
Directory: C:\MyLocalModulesMode LastWriteTime Length Name
---- ------------- ------ ----
d----- 12/14/2015 11:22 AM xPSDesiredStateConfiguration
The first command uses the Find-Module cmdlet to find the AzureAutomationDebug module in the PSGallery repository
and displays the results.The second command uses Find-Module to find the AzureAutomationDebug module and its dependencies, and displays the
results.The third command uses Find-Module to find the AzureAutomationDebug module, and then uses the pipeline operator to
pass the module to the Save-Module cmdlet, which save the module to the specified folder.
The fourth command displays the contents of the saved module.The fifth command saves the specified versions of the module xPSDesiredStateConfiguration to C:\MyLocalModules.
The final command displays the contents of the C:\MyLocalModules folder.RELATED LINKS
Online Version: http://go.microsoft.com/fwlink/?LinkId=821669Find-Module
Publish-Module
Uninstall-Module
Update-Module