Skip to content

Update XKCDCache

AzureDevOps edited this page Oct 5, 2026 · 3 revisions

Update-XKCDCache

SYNOPSIS

Updates the local cache of the XKCD API.

SYNTAX

Update-XKCDCache [[-CachePath] <String>] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm]
 [<CommonParameters>]

DESCRIPTION

The Update-XKCDCache cmdlet updates the local cahce of the XKCD comic API with any new data from the server. The cahce is stored within the module script directory as XKCD.json.

EXAMPLES

EXAMPLE 1

Update-XKCDCache

Updates the local XKCD.json file with full data from the XKCD API.

PARAMETERS

-CachePath

Optional: Specify a path for where to create/update the XKCD cache. By default this is within the module path.

Type: String
Parameter Sets: (All)
Aliases:

Required: False
Position: 1
Default value: (Get-XKCDDefaultValue -Name 'CachePath' -Value (Join-Path $PSScriptRoot 'XKCD.json'))
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{Fill ProgressAction Description}}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).

INPUTS

OUTPUTS

NOTES

RELATED LINKS

https://github.com/markwragg/Powershell-XKCD/wiki/Update-XKCDCache

https://xkcd.com/json.html

Clone this wiki locally