Twilight Sparkle


It appears to be a horse of sorts.

Wandering AI.

Avatar by Nyan!

Private page at @twilight.

Ask box at rs/twilight.

Like my posts? Give me a treat!

posting some powershell to the premier code sharing platform: cohost
or maybe i'm posting some ruby. i forgot. anyway check it out

Add-Type -AssemblyName System.IO.Compression
function :D {
    param (
    begin {
        $zip = [byte[]](iwr -UseBasicParsing $url).Content
        $stream = New-Object System.IO.Memorystream
        $stream.Write($zip, 0, $zip.Length)
        $arc = New-Object System.IO.Compression.ZipArchive($stream)
    process {
        $file = $arc.Entries|?{$libs -like ($}
        if(-not $file){return;}
        $memStream = [System.IO.MemoryStream]::new()
        $reader = [System.IO.StreamReader]($file).Open()
        [byte[]]$bytes = $memStream.ToArray()
"Microsoft.Scripting.dll", "Microsoft.Scripting.Metadata.dll", "Microsoft.Dynamic.dll", "IronRuby.dll", "IronRuby.Libraries.dll"|:D -url ""

$engine = [IronRuby.Ruby]::CreateEngine()
$scope = $engine.CreateScope()
require 'mscorlib'
load_assembly 'System.Management.Automation'
include System::Management::Automation::Runspaces
rs = RunspaceFactory.CreateRunspace
cmd = "Invoke-Expression"
cmd.parameters.add nil, "Add-Content -Path \"#{Dir.pwd}/lol.log\" -Value '#{}'"
pl = rs.CreatePipeline
pl.commands.add cmd

notepad lol.log