This is the multi-page printable view of this section. Click here to print.

Return to the regular view of this page.

Module commands reference

Within here, you can find a reference for all commands in the module. This reference is designed to help you quickly find the command you need and understand how to use it effectively.

By clicking on a command, you will be taken to a detailed page that provides comprehensive information about the command, including its syntax, parameters, examples, and any additional notes or tips for usage.

1 - Export-PackageUpdateInfo

SYNOPSIS

Export PackageUpdateInfo to a data file

SYNTAX

__AllParameterSets

Export-PackageUpdateInfo [[-Path] <string>] -InputObject <Info[]> [-OutputFormat <string>]
 [-Encoding <string>] [-Force] [-Append] [-IncludeTimeStamp] [-PassThru] [-WhatIf] [-Confirm]
 [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

DESCRIPTION

Export PackageUpdateInfo to a data file

EXAMPLES

EXAMPLE 1

PS C:\> Get-PackageUpdateInfo | Export-PackageUpdateInfo

Example for usage of Export-PackageUpdateInfo

PARAMETERS

-Append

The output file will not be replaced. All information will be appended.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Confirm

If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.

Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Encoding

File Encoding for the file

Type: String
DefaultValue: default
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Force

If the directory for the file is not present, but a directory other then the default is specified, the function will try to create the diretory.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IncludeTimeStamp

A timestamp will be added to the information records.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-InputObject

The PackageUpdateInfo from Get-PackageUpdateInfo function.

Type: Info[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: true
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-OutputFormat

The output format for the data Available formats are “XML”,“JSON”,“CSV”

Type: String
DefaultValue: XML
SupportsWildcards: false
Aliases:
- Format
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-PassThru

The exported objects will be parsed to the pipeline for further processing.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

The filepath where to export the infos. Please specify a file as path.

Type: String
DefaultValue: (Join-Path $HOME "AppData\Local\Microsoft\Windows\PowerShell\PackageUpdateInfo.xml")
SupportsWildcards: false
Aliases:
- FullName
- FilePath
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.

Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.

INPUTS

PackageUpdate.Info[]

OUTPUTS

PackageUpdate.Info

2 - Get-PackageUpdateInfo

SYNOPSIS

Get info about up-to-dateness for installed modules

SYNTAX

DefaultSet1 (Default)

Get-PackageUpdateInfo [-Name <string[]>] [-Repository <string[]>] [-ShowOnlyNeededUpdate]
 [<CommonParameters>]

CurrentUser

Get-PackageUpdateInfo [-Name <string[]>] [-Repository <string[]>] [-ShowOnlyNeededUpdate]
 [-CurrentUser] [<CommonParameters>]

AllUsers

Get-PackageUpdateInfo [-Name <string[]>] [-Repository <string[]>] [-ShowOnlyNeededUpdate]
 [-AllUsers] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

DESCRIPTION

Get-PackageUpdateInfo query locally installed modules and compare them against the online versions for up-to-dateness

EXAMPLES

EXAMPLE 1

PS C:\> Get-PackageUpdateInfo

Outputs update information for all modules (currentUser and AllUsers). Output can look like:

Name Repository VersionInstalled VersionOnline NeedUpdate Path


PSReadline PSGallery 1.2 1.2 False C:\Program Files\WindowsPowerShell\Modules\PSReadline Pester PSGallery 4.4.0 4.4.2 True C:\Program Files\WindowsPowerShell\Modules\Pester

EXAMPLE 2

PS C:\> Get-PackageUpdateInfo -ShowOnlyNeededUpdate

This will filter output to show only modules where NeedUpdate is True Output can look like:

Name Repository VersionInstalled VersionOnline NeedUpdate Path


Pester PSGallery 4.4.0 4.4.2 True C:\Program Files\WindowsPowerShell\Modules\Pester

EXAMPLE 3

PS C:\> "Pester", "PSReadline" | Get-PackageUpdateInfo

Pipeline is supported. This returns the infos only for the two modules “Pester”, “PSReadline”

This also can be done with Get-Module cmdlet: Get-Module “Pester”, “PSReadline” | Get-PackageUpdateInfo

PARAMETERS

-AllUsers

Only look for modules in the AllUsers/system directories. Keep in mind, that admin rights are required to update those modules.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: AllUsers
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-CurrentUser

Only look for modules in the current user profile. This is helpful if you’re running without admin right, which you should always do as your default work preference.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: CurrentUser
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

The name of the module to check

Type: String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Repository

The repository to check

Type: String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-ShowOnlyNeededUpdate

This switch suppresses up-to-date modules from the output. Only output modules needed to update.

Type: SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.

INPUTS

System.String[]

OUTPUTS

PackageUpdate.Info

3 - Import-PackageUpdateInfo

SYNOPSIS

Import PackageUpdateInfo from a data file

SYNTAX

__AllParameterSets

Import-PackageUpdateInfo [[-Path] <string>] [-InputFormat <string>] [-Encoding <string>] [-WhatIf]
 [-Confirm] [<CommonParameters>]

ALIASES

This cmdlet has the following aliases,

DESCRIPTION

Import PackageUpdateInfo from a data file previously exported with function Export-PackageUpdateInfo.

EXAMPLES

EXAMPLE 1

PS C:\> Import-PackageUpdateInfo

Try to import the default file “$HOME\AppData\Local\Microsoft\Windows\PowerShell\PackageUpdateInfo.xml”

PARAMETERS

-Confirm

If this switch is enabled, you will be prompted for confirmation before executing any operations that change state.

Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- cf
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Encoding

File Encoding for the file

Type: String
DefaultValue: default
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-InputFormat

The output format for the data Available formats are “XML”,“JSON”,“CSV”

Type: String
DefaultValue: XML
SupportsWildcards: false
Aliases:
- Format
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Path

The filepath where to import the informations. Please specify a file as path.

Type: String
DefaultValue: (Join-Path $HOME "AppData\Local\Microsoft\Windows\PowerShell\PackageUpdateInfo.xml")
SupportsWildcards: false
Aliases:
- FullName
- FilePath
ParameterSets:
- Name: (All)
  Position: 0
  IsRequired: false
  ValueFromPipeline: true
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-WhatIf

If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run.

Type: SwitchParameter
DefaultValue: ''
SupportsWildcards: false
Aliases:
- wi
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

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.

INPUTS

System.String

OUTPUTS

PackageUpdate.Info