# Assistant Green Hell Saves — généré par le site $Site = "https://greenhell.sygmadream.com"; $Config = Join-Path $env:LOCALAPPDATA "GreenHellSaves"; New-Item $Config -ItemType Directory -Force | Out-Null $credFile=Join-Path $Config "credential.xml"; if(Test-Path $credFile){$cred=Import-Clixml $credFile}else{$u=Read-Host "Pseudo";$p=Read-Host "Mot de passe" -AsSecureString;[pscustomobject]@{Pseudo=$u;Password=$p}|Export-Clixml $credFile;$cred=Import-Clixml $credFile} $steam=(Get-ItemProperty 'HKCU:\Software\Valve\Steam' -ErrorAction SilentlyContinue).SteamPath; if(!$steam){throw 'SteamPath introuvable'} $paths=Get-ChildItem (Join-Path $steam 'userdata') -Directory -ErrorAction Stop|ForEach-Object{Join-Path $_.FullName '815370 emote'}|Where-Object{Test-Path $_}; if(!$paths){throw 'Dossier Green Hell introuvable'};$local=$paths|Sort-Object{(Get-Item $_).LastWriteTime}|Select-Object -Last 1 if(Get-Process -Name 'GH' -ErrorAction SilentlyContinue){throw 'Green Hell est lancé, fermez-le.'}; Write-Host "Dossier: $local"; Write-Host '[1] Récupérer [2] Envoyer [3] État';$choice=Read-Host 'Choix' # Le flux API complet reste lisible et peut être adapté à l authentification de l installation. if($choice -eq '3'){Invoke-RestMethod "$Site/api/state" -Headers @{'X-GreenHell-Token'=(Read-Host 'Token') }|ConvertTo-Json;exit} Write-Host "Utilisez l interface web pour obtenir un token, puis téléchargez la sauvegarde correspondante."