Megosztás a következőn keresztül:


Update-PSResource

Downloads and installs the newest version of a package already installed on the local machine.

Syntax

Default (Alapértelmezett)

Update-PSResource
    [[-Name] <String[]>]
    [-Version <String>]
    [-Prerelease]
    [-Repository <String[]>]
    [-Scope <ScopeType>]
    [-TemporaryPath <String>]
    [-TrustRepository]
    [-Credential <PSCredential>]
    [-Quiet]
    [-AcceptLicense]
    [-Force]
    [-PassThru]
    [-SkipDependencyCheck]
    [-AuthenticodeCheck]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Update-PSResource downloads and installs the newest version of a package already installed on the local machine. This cmdlet replaces the Update-Module and Update-Script cmdlets from PowerShellGet v2. The new version of the resource is installed side-by-side with previous versions in a new versioned folder.

By default, Update-PSResource installs the latest version of the package and any of its dependencies without deleting the older versions installed. There is no command to uninstall older versions of a package. You must manually delete the files and folders of the older versions.

Update-PSResource doesn't load the updated module into the current session. You must import the new version or start a new session to use the updated module. For more information, see Import-Module.

Példák

Example 1

In this example, the user already has the TestModule package installed and they update the package.

Get-PSResource -Name "TestModule"
Name                                    Version                         Prerelease   Description
----                                    -------                         ----------   -----------
TestModule                              1.2.0                                        test
Update-PSResource -Name "TestModule"
Name                                    Version                         Prerelease   Description
----                                    -------                         ----------   -----------
TestModule                              1.3.0                                        test
TestModule                              1.2.0                                        test

Paraméterek

-AcceptLicense

For resources that require a license, AcceptLicense automatically accepts the license agreement during the update.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-AuthenticodeCheck

Validates signed files and catalog files on Windows.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False
Aliasok:cf

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Credential

Specifies optional credentials used when accessing a private repository.

Paramétertulajdonságok

Típus:PSCredential
Alapértelmezett érték:None
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Force

When specified, bypasses checks for TrustRepository and AcceptLicense and updates the package.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Name

Specifies the name of one or more resources to update. Wildcards are supported but NuGet only accepts the * character. NuGet doesn't support wildcard searches of local (file-based) repositories.

Paramétertulajdonságok

Típus:

String[]

Alapértelmezett érték:*
Támogatja a helyettesítő karaktereket:True
DontShow:False

Paraméterkészletek

(All)
Position:0
Kötelező:False
Folyamatból származó érték:True
Folyamatból származó érték tulajdonságnév alapján:True
Fennmaradó argumentumokból származó érték:False

-PassThru

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

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Prerelease

When specified, allows updating to a prerelease version.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Quiet

Suppresses progress information.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték: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. Update-PSResource updates 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.

Paramétertulajdonságok

Típus:

String[]

Alapértelmezett érték:None
Támogatja a helyettesítő karaktereket:True
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-Scope

Specifies the installation scope. Accepted values are:

  • CurrentUser
  • AllUsers

The default scope is CurrentUser, which doesn't require elevation.

Paramétertulajdonságok

Típus:Microsoft.PowerShell.PSResourceGet.UtilClasses.ScopeType
Alapértelmezett érték:None
Elfogadott értékek:CurrentUser, AllUsers
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-SkipDependencyCheck

Skips the check for resource dependencies. This means that only named resources are updated.

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-TemporaryPath

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

Paramétertulajdonságok

Típus:String
Alapértelmezett érték:None
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-TrustRepository

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

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték: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.

Paramétertulajdonságok

Típus:String
Alapértelmezett érték:None
Támogatja a helyettesítő karaktereket:True
DontShow:False

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték:False

-WhatIf

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

Paramétertulajdonságok

Típus:SwitchParameter
Alapértelmezett érték:False
Támogatja a helyettesítő karaktereket:False
DontShow:False
Aliasok:wi

Paraméterkészletek

(All)
Position:Named
Kötelező:False
Folyamatból származó érték:False
Folyamatból származó érték tulajdonságnév alapján:False
Fennmaradó argumentumokból származó érték: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.

Bevitelek

String

Kimenetek

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.

Jegyzetek

The module defines udres as an alias for Update-PSResource.