< Back

Save-Module

Wed Jan 30, 2019 5:57 pm

NAME Save-Module



SYNOPSIS

Saves a module locally without installing it.





SYNTAX

Save-Module [-InputObject] <PSObject[]> [-Confirm] [-Credential <PSCredential>] [-Force] -LiteralPath <String> [-Proxy <Uri>] [-ProxyCredential

<PSCredential>] [-WhatIf] [<CommonParameters>]



Save-Module [-InputObject] <PSObject[]> [-Confirm] [-Credential <PSCredential>] [-Force] -Path <String> [-Proxy <Uri>] [-ProxyCredential <PSCredential>]

[-WhatIf] [<CommonParameters>]



Save-Module [-Name] <String[]> [-Confirm] [-Credential <PSCredential>] [-Force] -LiteralPath <String> [-MaximumVersion <Version>] [-MinimumVersion

<Version>] [-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Repository <String[]>] [-RequiredVersion <Version>] [-WhatIf] [<CommonParameters>]



Save-Module [-Name] <String[]> [-Confirm] [-Credential <PSCredential>] [-Force] [-MaximumVersion <Version>] [-MinimumVersion <Version>] -Path <String>

[-Proxy <Uri>] [-ProxyCredential <PSCredential>] [-Repository <String[]>] [-RequiredVersion <Version>] [-WhatIf] [<CommonParameters>]





DESCRIPTION

The Save-Module cmdlet saves a module locally from the specified repository for inspection. The module is not installed.





PARAMETERS

-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-Credential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Force [<SwitchParameter>]

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 <PSObject[]>

{{Fill InputObject Description}}



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName, ByValue)

Accept wildcard characters? false



-LiteralPath <String>

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 <Version>

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 None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-MinimumVersion <Version>

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 None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Name <String[]>

Specifies an array of names of modules to save.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Path <String>

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 from Get-Module.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Proxy <Uri>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ProxyCredential <PSCredential>

@{Text=}



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-Repository <String[]>

Specifies the friendly name of a repository that has been registered by running Register-PSRepository.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-RequiredVersion <Version>

Specifies the exact version number of the module to save.



Required? false

Position? named

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



<CommonParameters>

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 Azure Automation 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

cmdlets

1.0.1 AzureRM.Automation Module PSGallery Microsoft Azure PowerShell - Automation service cmdlets for Azure

Resource Manager

1.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:\\MyLocalModules





Mode 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:\\MyLocalModules





Mode 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=821669

Find-Module

Publish-Module

Uninstall-Module

Update-Module