Set Shopify Theme Asset
Zuletzt geändert: 14.03.2026 05:56

Set-ShopifyThemeAsset #

ÜBERSICHT #

Schreibt oder aktualisiert ein Theme-Asset (Liquid-Datei) in einem Shopify-Theme.

SYNTAX #

Set-ShopifyThemeAsset [-Shop] <string> [-Token] <string> [-ApiVersion] <string> [-ThemeId] <long>
    [-AssetKey] <string> [-Value] <string> [[-MaxRetries] <int>] [[-TimeoutSec] <int>]
    [<CommonParameters>]

BESCHREIBUNG #

Führt PUT /admin/api/{version}/themes/{id}/assets.json aus. Shopify-Semantik: PUT = Upsert (erstellt oder aktualisiert). Bei HTTP 429 (Rate Limit) wartet die Funktion und wiederholt den Request.

PARAMETER #

-Shop #

Type: string

Shopify-Shop-Domain, z.B. ‘mein-shop.myshopify.com’.

-Token #

Type: string

Admin API Access Token (shpat_…) der Custom App.

-ApiVersion #

Type: string

API-Version, z.B. ‘2025-01’.

-ThemeId #

Type: long

Shopify Theme-ID.

-AssetKey #

Type: string

Pfad des Assets im Theme, z.B. ‘snippets/eulanda-order-documents.liquid’.

-Value #

Type: string

Inhalt des Assets (z.B. Liquid-Template-Code).

-MaxRetries #

Type: int
Default: 3

Maximale Anzahl Wiederholungen bei Rate-Limit (429).

-TimeoutSec #

Type: int
Default: 60

HTTP Timeout in Sekunden.

AUSGABEN #

pscustomobject -- Objekt mit Key und Value des geschriebenen Assets.

BEISPIELE #

Set-ShopifyThemeAsset -Shop 'mein-shop.myshopify.com' `
  -Token 'shpat_abc123' -ApiVersion '2025-01' `
  -ThemeId 123456789 -AssetKey 'snippets/eulanda-order-documents.liquid' `
  -Value '{% comment %} Test {% endcomment %}'