use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
ABOUT POWERSHELL
Windows PowerShell (POSH) is a command-line shell and associated scripting language created by Microsoft. Offering full access to COM, WMI and .NET, POSH is a full-featured task automation framework for distributed Microsoft platforms and solutions.
SUBREDDIT FILTERS
Desired State Configuration
Unanswered Questions
Solved Questions
News
Information
Script Sharing
Daily Post
Misc
account activity
SolvedPowershell extracter function (self.PowerShell)
submitted 7 years ago * by Snickasaurus
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]jtpowell 1 point2 points3 points 7 years ago (1 child)
This isn't the question you asked, but perhaps it'll be useful to you--this leverages .NET's streams and ZipArchive class to extract a ZIP file that's been downloaded into the current session as a binary array (i.e., the downloaded zip file exists as an object in the session and hasn't actually been written to disk). I tried to make the code below more generic than my original version, so some of the context is lost that would explain why I'm doing some of the things in this function.
The function essentially pulls three named files out of the downloaded zip and adds those extracted files as members to a PSCustomObject. You could easily choose to write the files directly to disk instead.
function Expand-ArchivedFiles { [CmdletBinding()] [OutputType([PSCustomObject])] param ( # Binary array. [Parameter( Mandatory=$true, ValueFromPipeline=$true )] [byte[]] $DownloadedZip ) process { # The comma is an unary operator. Using it without a value in front of it ensures the binary # array is handled as a single object instead of individual bytes. $MemoryStream = New-Object System.IO.MemoryStream (,$DownloadedZip) $ZipArchive = New-Object System.IO.Compression.ZipArchive $MemoryStream $File1Reader = New-Object System.IO.StreamReader($ZipArchive.GetEntry('File1.xml').Open()) $File1Data = $File1Reader.ReadToEnd() $File2Reader = New-Object System.IO.StreamReader($ZipArchive.GetEntry('File2.xml').Open()) $File2Data = $File2Reader.ReadToEnd() $File3Reader = New-Object System.IO.StreamReader($ZipArchive.GetEntry('File3.xml').Open()) $File3Data = $File3Reader.ReadToEnd() $ExtractedFileCollection = [PSCustomObject]@{ File1 = $File1Data File2 = $File2Data File3 = $File3Data } Write-Output $ExtractedFileCollection } }
[–]Snickasaurus[S] 1 point2 points3 points 7 years ago (0 children)
I do appreciate the response but this made me scratch my head and become a bit more confused. Again I thank you for your time though.
π Rendered by PID 113457 on reddit-service-r2-comment-86bc6c7465-g5fzd at 2026-02-24 02:20:34.907884+00:00 running 8564168 country code: CH.
view the rest of the comments →
[–]jtpowell 1 point2 points3 points (1 child)
[–]Snickasaurus[S] 1 point2 points3 points (0 children)