PowerShell PowerShell
一个用于 PowerShell 的 PowerShell 代码片段,以空 GIF 响应对 /pixel.gif 的请求,GIF 在启动时只解码一次。
PowerShell PowerShell
# 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)
我们运行了此代码片段,并比对了它返回的字节。