Свойство | Type | Description | |
---|---|---|---|
RefreshPackages | void | ||
WriteError | void | ||
WriteOutput | void |
Méthode | Description | |
---|---|---|
ExecutePackageCommand ( string commandString, bool refreshPackages = true ) : Task |
Executes a PowerShell command and returns whether or not there was a result. Optionally calls RefreshPackages.
|
|
GetPackages ( bool logOutput = false ) : Task |
Retrives all the local packages.
|
|
InstallPackageAsync ( string id, string version = null ) : Task |
Install the specific package. Optionally installs a specific version of the package.
|
|
IsInstalled ( string id, string version ) : bool |
Checks wether the specified package is installed. This method will only return true if: A) We've already retrieved the local packages and cached them. B) The package is found in the cache. This is to ensure that we're not pulling the local package list until the App specifically request it. |
|
LocalChocolateyService ( IRemoteChocolateyService remoteService ) : System.Collections.ObjectModel | ||
RunPackageCommand ( string commandString, bool refreshPackages = true, bool logOutput = true, bool clearBuffer = true ) : Task |
Executes a PowerShell Command.
|
|
UninstallPackageAsync ( string id, string version ) : Task |
Uninstall the specified package.
|
|
UpdatePackageAsync ( string id ) : Task |
Updates the installed package. Chocolatey does not currently support updating an installed package to a specific version. There's a way to do this (basically uninstall and install specific version), but it's complex and error prone enough that we're avoiding it for now. |
Méthode | Description | |
---|---|---|
RefreshPackages ( bool logOutput = false ) : void |
Invalidates and refreshes the cache.
|
|
WriteError ( string message ) : void |
Helper function to write error messages to the faux PowerShell console.
|
|
WriteOutput ( string message ) : void |
Helper function to write output messages to the faux PowerShell console.
|
public ExecutePackageCommand ( string commandString, bool refreshPackages = true ) : Task |
||
commandString | string | The PowerShell command string. |
refreshPackages | bool | Whether to call |
Résultat | Task |
public GetPackages ( bool logOutput = false ) : Task |
||
logOutput | bool | If true, writes messages out to the faux PowerShell console. |
Résultat | Task |
public InstallPackageAsync ( string id, string version = null ) : Task |
||
id | string | The Id of the package to be isntalled. |
version | string | The specific Version string of the package to be installed. |
Résultat | Task |
public IsInstalled ( string id, string version ) : bool | ||
id | string | The Id of the package. |
version | string | The Version string of the package. |
Résultat | bool |
public LocalChocolateyService ( IRemoteChocolateyService remoteService ) : System.Collections.ObjectModel | ||
remoteService | IRemoteChocolateyService | |
Résultat | System.Collections.ObjectModel |
public RunPackageCommand ( string commandString, bool refreshPackages = true, bool logOutput = true, bool clearBuffer = true ) : Task |
||
commandString | string | The PowerShell command string. |
refreshPackages | bool | Whether to call |
logOutput | bool | Whether the output should be logged to the faux PowerShell console or returned as results. |
clearBuffer | bool | Whether the faux PowerShell console should be cleared. |
Résultat | Task |
public UninstallPackageAsync ( string id, string version ) : Task |
||
id | string | The Id of the package to be removed. |
version | string | The Version string of the package to be removed. |
Résultat | Task |
public UpdatePackageAsync ( string id ) : Task |
||
id | string | The Id of the package. |
Résultat | Task |