Udostępnij za pośrednictwem


Save-PSResource

Saves resources (modules and scripts) from a registered repository onto the machine.

Składnia

IncludeXmlParameterSet (Domyślna)

Save-PSResource
    [-Name] <String[]>
    [-Version <String>]
    [-Prerelease]
    [-Repository <String[]>]
    [-Credential <PSCredential>]
    [-IncludeXml]
    [-Path <String>]
    [-TemporaryPath <String>]
    [-TrustRepository]
    [-PassThru]
    [-SkipDependencyCheck]
    [-AuthenticodeCheck]
    [-Quiet]
    [-AcceptLicense]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

AsNupkgParameterSet

Save-PSResource
    [-Name] <String[]>
    [-Version <String>]
    [-Prerelease]
    [-Repository <String[]>]
    [-Credential <PSCredential>]
    [-AsNupkg]
    [-Path <String>]
    [-TemporaryPath <String>]
    [-TrustRepository]
    [-PassThru]
    [-SkipDependencyCheck]
    [-AuthenticodeCheck]
    [-Quiet]
    [-AcceptLicense]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

InputObjectParameterSet

Save-PSResource
    [-InputObject] <PSResourceInfo[]>
    [-Repository <String[]>]
    [-Credential <PSCredential>]
    [-AsNupkg]
    [-IncludeXml]
    [-Path <String>]
    [-TemporaryPath <String>]
    [-TrustRepository]
    [-PassThru]
    [-SkipDependencyCheck]
    [-AuthenticodeCheck]
    [-Quiet]
    [-AcceptLicense]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Opis

This cmdlet combines the functionality of the Save-Module and Save-Script cmdlets from PowerShellGet v2. Save-PSResource downloads a resource from a registered repository to a specific path on the local machine. By default, the resource is saved in the unpacked or installed format. The scripts or modules could be run from the saved location. There is also an option to download the resource in .nupkg format.

Przykłady

Example 1

Downloads the Az module from the highest priority repository and saves it to the current location.

Save-PSResource -Name Az

Example 2

Downloads the Az module from the PowerShell Gallery and saves it to the current location.

Save-PSResource -Name Az -Repository PSGallery

Example 3

Downloads the Az module from the highest priority repository and saves it in .nupkg format to the current location.

Save-PSResource Az -AsNupkg

Example 4

Downloads the Az module from the highest priority repository and includes the PowerShellGet XML metadata file.

Save-PSResource Az -IncludeXML

Parametry

-AcceptLicense

For modules that require a license, automatically accepts the license agreement during installation.

This parameter was added in PSResourceGet 1.1.0-rc1.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-AsNupkg

Saves the resource as a .nupkg file.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

AsNupkgParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False
InputObjectParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-AuthenticodeCheck

Validates the resource's signed files and catalog files on Windows.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False
Aliasy:cf

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Credential

Optional credentials used when accessing a repository.

Właściwości parametru

Typ:PSCredential
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-IncludeXml

Includes the PowerShellGet metadata XML used to verify that PowerShellGet has installed a module.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

IncludeXmlParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False
InputObjectParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-InputObject

Used for pipeline input.

Właściwości parametru

Typ:

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo[]

Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False
Aliasy:ParentResource

Zestawy parametrów

InputObjectParameterSet
Position:0
Obowiązkowy:True
Wartość z potoku:True
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-Name

The name of one or more resources to install.

Właściwości parametru

Typ:

String[]

Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

IncludeXmlParameterSet
Position:0
Obowiązkowy:True
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False
AsNupkgParameterSet
Position:0
Obowiązkowy:True
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-PassThru

When specified, outputs a PSResourceInfo object for the saved resource.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Path

Specifies the path to save the resource to. If no path is provided, the resource is saved in the current directory.

Właściwości parametru

Typ:String
Domyślna wartość:current directory
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Prerelease

When specified, includes prerelease versions in search results returned.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False
Aliasy:IsPrerelease

Zestawy parametrów

IncludeXmlParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False
AsNupkgParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-Quiet

Suppresses the progress bar output.

This parameter was added in PSResourceGet 1.1.0-rc1.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Repository

Specifies one or more repository names to search. If not specified, search includes all registered repositories, in priority order (highest first), until a repository is found that contains the package. Repositories are sorted by priority then by name. Lower Priority values have a higher precedence.

When searching for resources across multiple repositories, the PSResourceGet cmdlets search the repositories using this sort order. Save-PSResource saves the first matching package from the sorted list of repositories.

The parameter supports the * wildcard character. If you specify multiple repositories, all names must include or omit the wildcard character. You can't specify a mix of names with and without wildcards.

Właściwości parametru

Typ:

String[]

Domyślna wartość:None
Obsługuje symbole wieloznaczne:True
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-SkipDependencyCheck

Skips the check for resource dependencies. Only found resources are installed. No resources of the found resource are installed.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-TemporaryPath

Specifies the path to temporarily install the resource before saving. If no temporary path is provided, the resource is temporarily installed in the current user's temporary folder.

Właściwości parametru

Typ:String
Domyślna wartość:None
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-TrustRepository

Suppress prompts to trust repository. The prompt to trust repository only occurs if the repository isn't configured as trusted.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

-Version

Specifies the version of the resource to be returned. The value can be an exact version or a version range using the NuGet versioning syntax.

For more information about NuGet version ranges, see Package versioning.

PowerShellGet supports all but the minimum inclusive version listed in the NuGet version range documentation. Using 1.0.0.0 as the version doesn't yield versions 1.0.0.0 and higher (minimum inclusive range). Instead, the value is considered to be the required version. To search for a minimum inclusive range, use [1.0.0.0, ] as the version range.

Właściwości parametru

Typ:String
Domyślna wartość:None
Obsługuje symbole wieloznaczne:True
DontShow:False

Zestawy parametrów

IncludeXmlParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False
AsNupkgParameterSet
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:True
Wartość z pozostałych argumentów:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet isn't run.

Właściwości parametru

Typ:SwitchParameter
Domyślna wartość:False
Obsługuje symbole wieloznaczne:False
DontShow:False
Aliasy:wi

Zestawy parametrów

(All)
Position:Named
Obowiązkowy:False
Wartość z potoku:False
Wartość z potoku według nazwy właściwości:False
Wartość z pozostałych argumentów:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Dane wejściowe

String

String

SwitchParameter

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo

Dane wyjściowe

Microsoft.PowerShell.PSResourceGet.UtilClasses.PSResourceInfo

By default, the cmdlet doesn't return any objects. When the PassThru parameter is used, the cmdlet outputs a PSResourceInfo object for the saved resource.