emptygif
言語: 日本語

すべての言語・フレームワーク

PowerShell PowerShell

/pixel.gif へのリクエストに空の GIF を返す、PowerShell 用の PowerShell スニペット。GIF は起動時に一度だけデコードします。

PowerShell PowerShell

ファイル
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)

このスニペットは実行し、返されたバイト列を照合しました。

公式サイト: PowerShell

PowerShell の他の例