<# script.medve.hu - saját PowerShell scriptek Menü (kiválasztod, és lefut): irm script.medve.hu | iex Egy script közvetlenül: irm script.medve.hu/ | iex Csak megnézni (nem futtatja): irm script.medve.hu/ Elérhető scriptek: remap Hálózati meghajtók listázása, a kijelöltek lecsatolása és újracsatolása #> & { $scripts = @( @{ Name = 'remap'; Desc = 'Hálózati meghajtók listázása, a kijelöltek lecsatolása és újracsatolása' } ) while ($true) { Write-Host '' Write-Host ' _ _' -ForegroundColor DarkYellow Write-Host ' ( `---'' )' -ForegroundColor DarkYellow Write-Host ' ) o o (' -NoNewline -ForegroundColor DarkYellow Write-Host ' script.medve.hu' -ForegroundColor Cyan Write-Host ' ( (_) )' -ForegroundColor DarkYellow Write-Host ' `-...-''' -ForegroundColor DarkYellow Write-Host '' for ($i = 0; $i -lt $scripts.Count; $i++) { Write-Host (' {0,2}) ' -f ($i + 1)) -NoNewline -ForegroundColor Yellow Write-Host ('{0,-16}' -f $scripts[$i].Name) -NoNewline Write-Host $scripts[$i].Desc -ForegroundColor DarkGray } Write-Host ' 0) ' -NoNewline -ForegroundColor Yellow Write-Host 'Kilépés' Write-Host '' $choice = (Read-Host 'Melyiket futtassam').Trim() if ($choice -eq '0' -or $choice -eq 'q') { break } $n = 0 if (-not [int]::TryParse($choice, [ref]$n) -or $n -lt 1 -or $n -gt $scripts.Count) { Write-Host ' Érvénytelen választás.' -ForegroundColor Red continue } $s = $scripts[$n - 1] Write-Host " -> $($s.Name) indítása..." -ForegroundColor Cyan try { $code = Invoke-RestMethod "https://script.medve.hu/$($s.Name)" # Saját hatókörben fut, így nem szemeteli tele a menü változóit & ([scriptblock]::Create($code)) } catch { Write-Host " Hiba: $_" -ForegroundColor Red } Write-Host " <- $($s.Name) befejeződött." -ForegroundColor Cyan } }