Proxy Information
Original URL
gemini://g.mikf.pl/fragmlog/2023-04-01-powershell--files/changes.ps1.diff
Status Code
Success (20)
Meta
text/gemini diff --git a/./before_changes.ps1 b/./after_changes.ps1 index 7f7f27a..42dfb08 100644 --- a/./before_changes.ps1 +++ b/./after_changes.ps1 @@ -1,4 +1,11 @@ +param ( + [Parameter(Position = 0)] + [ScriptBlock]$ScriptBlock = { } +) + +$TheContentJob = & { $TempFile = New-TemporaryFile +Write-Information "Temporary file name '$TempFile'. " -InformationAction Continue -Import-Module ` +& { Import-Module ` "C:\Users\Mika Feiler\$( )\source\repos\DotnetTarGzipper\$( )\bin\Release\net7.0\DotnetTarGzipper.dll" @@ -12,10 +19,6 @@ Set-Location $GemCap +"# Mika Feiler%n=> tinylog.gmi %F Tinylog" > gemfeed-tinylog.gmi' Pop-Location  -$TempFile = New-TemporaryFile -Write-Host "Temporary file name '$TempFile'. " -$SrHtTokenKey = "SrHtToken_g.mikf.pl" - Get-ChildItem $GemCap -File -Recurse -Name | Where-Object { $_ -NotMatch "^(.*[\\\/])?\..*" } | ForEach-Object { $_ -replace '\\', '/' } | @@ -23,9 +26,15 @@ New-Tar (Resolve-Path $GemCap) | Compress-Gzip | Set-Content -Path $TempFile -AsByteStream  -Write-Host "Finished creating archive. " +Write-Information "Finished creating archive. " -InformationAction Continue +} 1>$null +return $TempFile +} & + +& ScriptBlock &  function Get-SrHtToken { + $SrHtTokenKey = "SrHtToken_g.mikf.pl" $SrHtToken = Get-Secret $SrHtTokenKey -ErrorVariable NoSrhtToken if($NoSrhtToken.Exception -Is ` [System.Management.Automation.ItemNotFoundException]) { @@ -34,12 +43,16 @@ function Get-SrHtToken { } $SrHtToken } +$TempFile = Get-ChildItem -Path (Wait-Job $TheContentJob | Receive-Job) Invoke-WebRequest -Method Post ` -Uri "https://pages.sr.ht/publish/g.mikf.pl" ` -Authentication OAuth -Token (Get-SrHtToken) ` -Form @{ protocol = "GEMINI" - content = Get-ChildItem $TempFile + content = $TempFile } ` -RetryIntervalSec 2 -MaximumRetryCount 3 | ForEach-Object { Write-Host $_.RawContent } +Remove-Job $TheContentJob +Write-Information -InformationAction Continue "Actual:" +Get-FileHash -Algorithm SHA256 $TempFile | foreach-object { Write-Host $_.Hash.ToLower() }
Capsule Response Time
137.024894 milliseconds
Gemini-to-HTML Time
0.009963 milliseconds

This content has been proxied by September (ba2dc).