Table of contents
TOC
Réduire la table des matières
Développer la table des matières

Découverte, installation et gestion des scripts PowerShell avec PowerShellGet

OpenLocalizationService|Dernière mise à jour: 07/12/2016
|
1 Contributeur

La fonctionnalité de partage de script PowerShell a été ajoutée à PowerShellGet dans la version WMF 5.0 RTM. Les nouvelles applets de commande suivantes ont été ajoutées au module PowerShellGet pour prendre en charge les scripts PowerShell.

PS C:\\windows\\system32> Get-Command \*script\* -Module PowerShellGet | Sort-Object -Property Noun, Verb
CommandType Name Version Source
----------- ---- ------- ------
Function Get-InstalledScript 1.0.0.1 PowerShellGet
Function Find-Script 1.0.0.1 PowerShellGet
Function Install-Script 1.0.0.1 PowerShellGet
Function Publish-Script 1.0.0.1 PowerShellGet
Function Save-Script 1.0.0.1 PowerShellGet
Function Uninstall-Script 1.0.0.1 PowerShellGet
Function Update-Script 1.0.0.1 PowerShellGet
Function New-ScriptFileInfo 1.0.0.1 PowerShellGet
Function Test-ScriptFileInfo 1.0.0.1 PowerShellGet
Function Update-ScriptFileInfo 1.0.0.1 PowerShellGet
-   **Find-Script** cmdlet lets you to discover the script files with different search criteria like name, tag, filter, command name, version range, exact version, all versions, including its dependencies and from specific or all registered repositories.
-   **Save-Script** cmdlet lets you to review the script file by saving it to a specified location.
-   **Install-Script** cmdlet lets you to install a specific script file along with its dependencies to the specified scope. By default, scripts are installed to the AllUsers scope.
-   **Update-Script** cmdlet lets you to do in-place update of the script files which were installed using Install-Script cmdlet.
-   **Get-InstalledScript** cmdlet lets you to get the list of script files which were installed using Install-Script cmdlet.
-   **Uninstall-Script** cmdlet lets you to uninstall the installed script files.
-   **Publish-Script** cmdlet lets you to publish your script file with valid metadata like Version, Guid, Author, and Description, etc.
-   **New-ScriptFileInfo** cmdlet lets you to create a new script file with metadata like Version, Guid, Author, and Description, etc.
-   **Update-ScriptFileInfo** cmdlet lets you to update the existing script file metadata.
-   **Test-ScriptFileInfo** cmdlet lets you to validate and get the script file metadata.

Syntaxe des applets de commande de partage de script :

**New-ScriptFileInfo** \[-Path\] <string> -Description <string> \[-Version <version>\] \[-Author <string>\] \[-Guid <guid>\] \[-CompanyName <string>\] \[-Copyright <string>\] \[-RequiredModules <Object\[\]>\] \[-ExternalModuleDependencies <string\[\]>\] \[-RequiredScripts <string\[\]>\] \[-ExternalScriptDependencies <string\[\]>\] \[-Tags <string\[\]>\] \[-ProjectUri <uri>\] \[-LicenseUri <uri>\] \[-IconUri <uri>\] \[-ReleaseNotes <string\[\]>\] \[-PassThru\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Test-ScriptFileInfo** \[-Path\] <string> \[<CommonParameters>\]

**Test-ScriptFileInfo** -LiteralPath <string> \[<CommonParameters>\]

**Update-ScriptFileInfo** \[-Path\] <string> \[-Version <version>\] \[-Author <string>\] \[-Guid <guid>\] \[-Description <string>\] \[-CompanyName <string>\] \[-Copyright <string>\] \[-RequiredModules <Object\[\]>\] \[-ExternalModuleDependencies <string\[\]>\] \[-RequiredScripts <string\[\]>\] \[-ExternalScriptDependencies <string\[\]>\] \[-Tags <string\[\]>\] \[-ProjectUri <uri>\] \[-LicenseUri <uri>\] \[-IconUri <uri>\] \[-ReleaseNotes <string\[\]>\] \[-PassThru\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Update-ScriptFileInfo** \[-LiteralPath\] <string> \[-Version <version>\] \[-Author <string>\] \[-Guid <guid>\] \[-Description <string>\] \[-CompanyName <string>\] \[-Copyright <string>\] \[-RequiredModules <Object\[\]>\] \[-ExternalModuleDependencies <string\[\]>\] \[-RequiredScripts <string\[\]>\] \[-ExternalScriptDependencies <string\[\]>\] \[-Tags <string\[\]>\] \[-ProjectUri <uri>\] \[-LicenseUri <uri>\] \[-IconUri <uri>\] \[-ReleaseNotes <string\[\]>\] \[-PassThru\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Find-Script** \[\[-Name\] <string\[\]>\] \[-MinimumVersion <version>\] \[-MaximumVersion <version>\] \[-RequiredVersion <version>\] \[-AllVersions\] \[-IncludeDependencies\] \[-Filter <string>\] \[-Tag <string\[\]>\] \[-Includes <string\[\]>\] \[-Command <string\[\]>\] \[-Repository <string\[\]>\] \[<CommonParameters>\]

**Install-Script** \[-Name\] <string\[\]> \[-MinimumVersion <version>\] \[-MaximumVersion <version>\] \[-RequiredVersion <version>\] \[-Repository <string\[\]>\] \[-Scope <string>\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Install-Script** \[-InputObject\] <psobject\[\]> \[-Scope <string>\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Update-Script** \[\[-Name\] <string\[\]>\] \[-RequiredVersion <version>\] \[-MaximumVersion <version>\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Get-InstalledScript** \[\[-Name\] <string\[\]>\] \[-MinimumVersion <version>\] \[-RequiredVersion <version>\] \[-MaximumVersion <version>\] \[<CommonParameters>\]

**Uninstall-Script** \[-Name\] <string\[\]> \[-MinimumVersion <version>\] \[-RequiredVersion <version>\] \[-MaximumVersion <version>\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Uninstall-Script** \[-InputObject\] <psobject\[\]> \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Save-Script** \[-Name\] <string\[\]> -Path <string> \[-MinimumVersion <version>\] \[-MaximumVersion <version>\] \[-RequiredVersion <version>\] \[-Repository <string\[\]>\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Save-Script** \[-Name\] <string\[\]> -LiteralPath <string> \[-MinimumVersion <version>\] \[-MaximumVersion <version>\] \[-RequiredVersion <version>\] \[-Repository <string\[\]>\] \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Save-Script** \[-InputObject\] <psobject\[\]> -LiteralPath <string> \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Save-Script** \[-InputObject\] <psobject\[\]> -Path <string> \[-Force\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Publish-Script** -Path <string> \[-NuGetApiKey <string>\] \[-Repository <string>\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]

**Publish-Script** -LiteralPath <string> \[-NuGetApiKey <string>\] \[-Repository <string>\] \[-WhatIf\] \[-Confirm\] \[<CommonParameters>\]
© 2017 Microsoft