emptygif
Langue: Français

Tous les langages et frameworks

PowerShell PowerShell

Un extrait PowerShell pour PowerShell qui répond aux requêtes sur /pixel.gif avec le GIF vide, décodé une seule fois au démarrage.

PowerShell PowerShell

Fichier
pixel.ps1
# Works in Windows PowerShell 5.1 and PowerShell 7+ (.NET needs an absolute path).
$bytes = [Convert]::FromBase64String('R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==')
[IO.File]::WriteAllBytes((Join-Path $PWD 'pixel.gif'), $bytes)

Nous avons exécuté cet extrait et comparé les octets qu’il a renvoyés.

Site officiel: PowerShell

Autres extraits en PowerShell