EulandaXtools — Funktionsreferenz
Schreibt oder aktualisiert ein Theme-Asset (Liquid-Datei) in einem Shopify-Theme.
Set-ShopifyThemeAsset [-Shop] <string> [-Token] <string> [-ApiVersion] <string> [-ThemeId] <long>
[-AssetKey] <string> [-Value] <string> [[-MaxRetries] <int>] [[-TimeoutSec] <int>]
[<CommonParameters>]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.
-Shop
Type: stringShopify-Shop-Domain, z.B. 'mein-shop.myshopify.com'.
-Token
Type: stringAdmin API Access Token (shpat_...) der Custom App.
-ApiVersion
Type: stringAPI-Version, z.B. '2025-01'.
-ThemeId
Type: longShopify Theme-ID.
-AssetKey
Type: stringPfad des Assets im Theme, z.B. 'snippets/eulanda-order-documents.liquid'.
-Value
Type: stringInhalt des Assets (z.B. Liquid-Template-Code).
-MaxRetries
Type: int
Default: 3Maximale Anzahl Wiederholungen bei Rate-Limit (429).
-TimeoutSec
Type: int
Default: 60HTTP Timeout in Sekunden.
pscustomobject -- Objekt mit Key und Value des geschriebenen Assets.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 %}'